nordigen-ruby 2.1.1 → 2.1.3

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: 7007af42e82905ff97e0c5dbf1dc3647019486589986a5ee51db005dfe1e82c4
4
+ data.tar.gz: ddc7320cda8140c66976062e9377f77e403fafa5081fd94d7d32dc879062d733
5
5
  SHA512:
6
- metadata.gz: c8ec5f76a1e98dae6937a5b52cab3f28fb5ca4a501b720e1ad070807543ba68f34c7174939bd4852cbd6d3e0f1e1b5aa8b00dbcf8be37e796d3744df4ea22a53
7
- data.tar.gz: 764bb5d85ca91eb66a9f04b4687bfe6eef0e635adf5913e4cc9db250267590eff07486f1478125a6dc5ea10983560c7c508be9742df27c16599bb1a6f39b0dc3
6
+ metadata.gz: f85ae5fd50036b9c19db2e93b2128dcca9b218c0d419ae035906d6c1f2fca96b5c36aa24fb41fd9fc6ea8d6f5896ad9ec0bd1e399e0ccea3f0aa432cb220afa3
7
+ data.tar.gz: 8f862f8d8acd0ccdb56aa235fb6699a9f28acadab44e66261e4d835ff4664459d9acbf81d7a2dcc0d026d510bd3c5a112707b8819b3f8f8f0bc49e104708240f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.3] - 2023-13-07
4
+
5
+ - Update URLs to GoCardless
6
+
7
+ ## [2.1.2] - 2022-12-19
8
+
9
+ - Fix redirect_immediate parameter
10
+ - Add SSN parameter
11
+ - Add access_valid_for_days for init method
12
+
3
13
  ## [2.1.1] - 2022-12-19
4
14
 
5
15
  - [add redirect_immediate param #20](https://github.com/nordigen/nordigen-ruby/pull/20)
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Nordigen Ruby Library
2
2
 
3
- This is official Ruby client library for [Nordigen](https://nordigen.com/en).
3
+ This is official Ruby client library for [GoCardless Bank Account Data](https://gocardless.com/bank-account-data/).
4
4
 
5
- For a full list of endpoints and arguments, see the [docs](https://nordigen.com/en/account_information_documenation/api-documention/overview/).
5
+ For a full list of endpoints and arguments, see the [docs](https://developer.gocardless.com/bank-account-data/quick-start-guide).
6
6
 
7
- Before starting to use API you will need to create a new secret and get your `SECRET_ID` and `SECRET_KEY` from the [Nordigen's Open Banking Portal](https://ob.nordigen.com/user-secrets/).
7
+ Before starting to use API you will need to create a new secret and get your `SECRET_ID` and `SECRET_KEY` from the [GoCardless Bank Account Data Portal](https://bankaccountdata.gocardless.com/user-secrets/).
8
8
 
9
9
  ## Requirements
10
10
 
@@ -31,7 +31,7 @@ Example code can be found in `main.rb` file and Ruby on Rails example applicatio
31
31
  require 'securerandom'
32
32
  require 'nordigen-ruby'
33
33
 
34
- # Get secret_id and secret_key from ob.nordigen.com portal and pass to NordigenClient or load from .env file
34
+ # Get secret_id and secret_key from bankaccountdata.gocardless.com/user-secrets/ portal and pass to NordigenClient or load from .env file
35
35
  client = Nordigen::NordigenClient.new(
36
36
  secret_id: "SECRET_ID",
37
37
  secret_key: "SECRET_KEY"
@@ -62,7 +62,7 @@ id = "REVOLUT_REVOGB21"
62
62
  # Returns requisition_id and link to initiate authorization with a bank
63
63
  init = client.init_session(
64
64
  # redirect url after successful authentication
65
- redirect_url: "https://nordigen.com",
65
+ redirect_url: "https://gocardless.com",
66
66
  # institution id
67
67
  institution_id: id,
68
68
  # a unique user ID of someone who's using your services, usually it's a UUID
@@ -88,10 +88,10 @@ After successful authorization with a bank you can fetch your data (details, bal
88
88
  # Get account id after you have completed authorization with a bank.
89
89
  requisition_data = client.requisition.get_requisition_by_id(requisition_id)
90
90
  # Get account id from list
91
- account_id = accounts["accounts"][0]
91
+ account_id = requisition_data["accounts"][0]
92
92
 
93
93
  # Instantiate account object
94
- account = client.account_api(account_id)
94
+ account = client.account(account_id)
95
95
 
96
96
  # Fetch account metadata
97
97
  meta_data = account.get_metadata()
@@ -116,4 +116,4 @@ bundle exec rake test
116
116
 
117
117
  ## Support
118
118
 
119
- For any inquiries please contact support at [support@nordigen.com](support@nordigen.com) or create an issue in repository.
119
+ For any inquiries please contact support at [bank-account-data-support@gocardless.com](bank-account-data-support@gocardless.com) or create an issue in repository.
data/lib/nordigen-ruby.rb CHANGED
@@ -8,7 +8,7 @@ require_relative "nordigen_ruby/api/account"
8
8
  module Nordigen
9
9
  class NordigenClient
10
10
 
11
- BASE_URL = "https://ob.nordigen.com/api/v2/"
11
+ BASE_URL = "https://ob.gocardless.com/api/v2/"
12
12
 
13
13
  @@headers = {
14
14
  "accept" => "application/json",
@@ -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.3"
5
5
  end
data/nordigen.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.name = "nordigen-ruby"
9
9
  spec.version = Nordigen::VERSION
10
10
  spec.authors = ["Nordigen Solutions"]
11
- spec.email = ["support@nordigen.com"]
11
+ spec.email = ["bank-account-data-support@gocardless.com"]
12
12
  spec.summary = "Nordigen client for Ruby"
13
13
  spec.homepage = "https://github.com/nordigen/nordigen-ruby"
14
14
  spec.description = "Nordigen official API client for Ruby"
metadata CHANGED
@@ -1,14 +1,14 @@
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nordigen Solutions
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-19 00:00:00.000000000 Z
11
+ date: 2023-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -26,7 +26,7 @@ dependencies:
26
26
  version: '2.5'
27
27
  description: Nordigen official API client for Ruby
28
28
  email:
29
- - support@nordigen.com
29
+ - bank-account-data-support@gocardless.com
30
30
  executables:
31
31
  - console
32
32
  - setup
@@ -57,7 +57,7 @@ metadata:
57
57
  documentation_uri: https://github.com/nordigen/nordigen-ruby
58
58
  github_repo: https://github.com/nordigen/nordigen-ruby
59
59
  source_code_uri: https://github.com/nordigen/nordigen-ruby
60
- post_install_message:
60
+ post_install_message:
61
61
  rdoc_options: []
62
62
  require_paths:
63
63
  - lib
@@ -72,8 +72,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  requirements: []
75
- rubygems_version: 3.0.3.1
76
- signing_key:
75
+ rubygems_version: 3.2.15
76
+ signing_key:
77
77
  specification_version: 4
78
78
  summary: Nordigen client for Ruby
79
79
  test_files: []