nordigen-ruby 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da14c07f1879ab720a319c6370c3b800355c955d5f7b07201565a2fd71eb4ac4
4
- data.tar.gz: 026517f99f4059a3e25336c7b7b743595cf1e59d0a18cc0bbd2b3df605985985
3
+ metadata.gz: bdad3a2c238fe265d411385287ac6b43be13db699330bf348e36bb4ad8563073
4
+ data.tar.gz: e1ac77775d3652715a5d553cc27415b7ef33aaed5880298a29cc397500f7e3e8
5
5
  SHA512:
6
- metadata.gz: c8ec5f76a1e98dae6937a5b52cab3f28fb5ca4a501b720e1ad070807543ba68f34c7174939bd4852cbd6d3e0f1e1b5aa8b00dbcf8be37e796d3744df4ea22a53
7
- data.tar.gz: 764bb5d85ca91eb66a9f04b4687bfe6eef0e635adf5913e4cc9db250267590eff07486f1478125a6dc5ea10983560c7c508be9742df27c16599bb1a6f39b0dc3
6
+ metadata.gz: 3e64587923d992c8e9593856019b5ceb736e7a122a486fdaa3e82e60e997016109596c4ba6ecf2d575c7514e83b70f495be53ac812435a2d5f1c0ff1e945dccd
7
+ data.tar.gz: 1769761d3f1b2d2909cab88bb33c9a872e1bf5a3c7a232fd49c2f309bade086ac5e042c29917bfba6f578a84c5246c472ed3f9060995c0580de0d76b7bd0d89b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.0] - 2022-12-19
4
+
5
+ - Fix redirect_immediate parameter
6
+ - Add SSN parameter
7
+ - Add access_valid_for_days for init method
8
+
3
9
  ## [2.1.1] - 2022-12-19
4
10
 
5
11
  - [add redirect_immediate param #20](https://github.com/nordigen/nordigen-ruby/pull/20)
data/lib/nordigen-ruby.rb CHANGED
@@ -77,7 +77,17 @@ module Nordigen
77
77
  return AccountApi.new(client: self, account_id: account_id)
78
78
  end
79
79
 
80
- def init_session(redirect_url:, institution_id:, reference_id:, max_historical_days: 90, user_language: "en", account_selection: false)
80
+ def init_session(
81
+ redirect_url:,
82
+ institution_id:,
83
+ reference_id:,
84
+ max_historical_days: 90,
85
+ access_valid_for_days: 90,
86
+ user_language: "en",
87
+ account_selection: false,
88
+ redirect_immediate: false,
89
+ ssn: nil
90
+ )
81
91
  # Factory method that creates authorization in a specific institution
82
92
  # and are responsible for the following steps:
83
93
  # * Creates agreement
@@ -86,8 +96,10 @@ module Nordigen
86
96
  # Create agreement
87
97
  new_agreement = @agreement.create_agreement(
88
98
  institution_id: institution_id,
89
- max_historical_days: max_historical_days
99
+ max_historical_days: max_historical_days,
100
+ access_valid_for_days: access_valid_for_days
90
101
  )
102
+
91
103
  # Create requisition
92
104
  new_requsition = @requisition.create_requisition(
93
105
  redirect_url: redirect_url,
@@ -95,7 +107,9 @@ module Nordigen
95
107
  institution_id: institution_id,
96
108
  user_language: user_language,
97
109
  account_selection: account_selection,
98
- agreement: new_agreement["id"]
110
+ redirect_immediate: redirect_immediate,
111
+ agreement: new_agreement["id"],
112
+ ssn: ssn
99
113
  )
100
114
 
101
115
  return new_requsition
@@ -9,21 +9,36 @@ module Nordigen
9
9
  @client = client
10
10
  end
11
11
 
12
- def create_requisition(redirect_url:, reference:, institution_id:, user_language: "en", agreement: nil, account_selection: false, redirect_immediate: false)
12
+ def create_requisition(
13
+ redirect_url:,
14
+ reference:,
15
+ institution_id:,
16
+ user_language: "en",
17
+ agreement: nil,
18
+ account_selection: false,
19
+ redirect_immediate: false,
20
+ ssn: nil
21
+ )
13
22
  # Create requisition. For creating links and retrieving accounts.
23
+ # puts account_selection
24
+ # puts redirect_immediate
14
25
  payload = {
15
26
  "redirect": redirect_url,
16
27
  "reference": reference,
17
28
  "institution_id": institution_id,
18
29
  "user_language": user_language,
19
30
  "account_selection": account_selection,
20
- "redirect_immediate" redirect_immediate
31
+ "redirect_immediate": redirect_immediate,
21
32
  }
22
33
 
23
34
  if agreement
24
35
  payload["agreement"] = agreement
25
36
  end
26
-
37
+
38
+ if ssn
39
+ payload["ssn"] = ssn
40
+ end
41
+
27
42
  return client.request.post(ENDPOINT, payload).body
28
43
  end
29
44
 
@@ -40,7 +55,7 @@ module Nordigen
40
55
  end
41
56
 
42
57
  def delete_requisition(requisition_id)
43
- # Delete requisition by id
58
+ # Delete requisition by id
44
59
  return client.request.delete("#{ENDPOINT}#{requisition_id}/").body
45
60
  end
46
61
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nordigen
4
- VERSION = "2.1.1"
4
+ VERSION = "2.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nordigen-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nordigen Solutions