nordigen-ruby 2.0.1 → 2.1.1

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: 445059abe1ee582647221e533d92e89a243e9c7f637776002225be85289ef64d
4
- data.tar.gz: 0ce7d206fbf78c37416df9ae8313ed28559e820e6cc7832a860483c46caabb30
3
+ metadata.gz: da14c07f1879ab720a319c6370c3b800355c955d5f7b07201565a2fd71eb4ac4
4
+ data.tar.gz: 026517f99f4059a3e25336c7b7b743595cf1e59d0a18cc0bbd2b3df605985985
5
5
  SHA512:
6
- metadata.gz: 459a417aaf13415867fc01ad93dd639339749adb1b64284f48315720710d723d11d1bfcb1aa1776714040ce24a3f4caa436cba01db24a623a274effc7fb3a965
7
- data.tar.gz: 421d38eb25afae34c425fce941378ea13a4942c0ad8a96c97b187348ec1a1dee1afe7dd8b48f4906bcd490f6b838fa8fe6a642fcf427997fc05f8280daa7f8cf
6
+ metadata.gz: c8ec5f76a1e98dae6937a5b52cab3f28fb5ca4a501b720e1ad070807543ba68f34c7174939bd4852cbd6d3e0f1e1b5aa8b00dbcf8be37e796d3744df4ea22a53
7
+ data.tar.gz: 764bb5d85ca91eb66a9f04b4687bfe6eef0e635adf5913e4cc9db250267590eff07486f1478125a6dc5ea10983560c7c508be9742df27c16599bb1a6f39b0dc3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.1] - 2022-12-19
4
+
5
+ - [add redirect_immediate param #20](https://github.com/nordigen/nordigen-ruby/pull/20)
6
+
7
+
8
+ ## [2.1.0] - 2022-12-15
9
+
10
+ - [Add user_language and account_selection params for requisition #18](https://github.com/nordigen/nordigen-ruby/pull/18)
11
+ - [Add a transactions premium option #19](https://github.com/nordigen/nordigen-ruby/pull/19)
12
+
3
13
  ## [2.0.1] - 2022-12-09
4
14
 
5
15
  - [Fix date filter #15](https://github.com/nordigen/nordigen-ruby/pull/15)
data/README.md CHANGED
@@ -66,7 +66,11 @@ init = client.init_session(
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
69
- reference_id: SecureRandom.uuid
69
+ reference_id: SecureRandom.uuid,
70
+ # A two-letter country code (ISO 639-1)
71
+ user_language: "en",
72
+ # option to enable account selection view for the end user
73
+ account_selection: true
70
74
  )
71
75
 
72
76
  link = init["link"] # bank authorization link
@@ -97,6 +101,8 @@ details = account.get_details()
97
101
  balances = account.get_balances()
98
102
  # Fetch transactions
99
103
  transactions = account.get_transactions()
104
+ # Fetch premium transactions
105
+ transactions = account.get_premium_transactions(date_from: "2021-12-01", date_to: "2022-01-30", country: "LV")
100
106
  # Filter transactions by specific date range
101
107
  transactions = account.get_transactions(date_from: "2021-12-01", date_to: "2022-01-30")
102
108
  ```
data/lib/nordigen-ruby.rb CHANGED
@@ -77,7 +77,7 @@ 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)
80
+ def init_session(redirect_url:, institution_id:, reference_id:, max_historical_days: 90, user_language: "en", account_selection: false)
81
81
  # Factory method that creates authorization in a specific institution
82
82
  # and are responsible for the following steps:
83
83
  # * Creates agreement
@@ -93,6 +93,8 @@ module Nordigen
93
93
  redirect_url: redirect_url,
94
94
  reference: reference_id,
95
95
  institution_id: institution_id,
96
+ user_language: user_language,
97
+ account_selection: account_selection,
96
98
  agreement: new_agreement["id"]
97
99
  )
98
100
 
@@ -2,6 +2,7 @@ module Nordigen
2
2
  class AccountApi
3
3
 
4
4
  ENDPOINT = "accounts/"
5
+ PREMIUM_ENDPOINT = "accounts/premium/"
5
6
  attr_reader :client, :account_id
6
7
 
7
8
  def initialize(client:, account_id:)
@@ -9,9 +10,14 @@ module Nordigen
9
10
  @account_id = account_id
10
11
  end
11
12
 
12
- def get(path = nil, params = nil)
13
+ def get(path = nil, params = nil, premium: nil)
13
14
  # Create Get request
14
- url = "#{ENDPOINT}#{@account_id}/"
15
+ if premium
16
+ url = "#{PREMIUM_ENDPOINT}#{@account_id}/"
17
+ else
18
+ url = "#{ENDPOINT}#{@account_id}/"
19
+ end
20
+
15
21
  if path
16
22
  url = "#{url}#{path}/"
17
23
  end
@@ -44,5 +50,15 @@ module Nordigen
44
50
  return get("transactions", date_range)
45
51
  end
46
52
 
53
+ def get_premium_transactions(date_from: nil, date_to: nil, country: nil)
54
+ # Access account transactions
55
+ params = {
56
+ "date_from" => date_from,
57
+ "date_to" => date_to,
58
+ "country" => country
59
+ }
60
+ return get("transactions", params, premium: true )
61
+ end
62
+
47
63
  end
48
64
  end
@@ -1,4 +1,3 @@
1
-
2
1
  module Nordigen
3
2
  class RequisitionsApi
4
3
 
@@ -10,14 +9,16 @@ module Nordigen
10
9
  @client = client
11
10
  end
12
11
 
13
- def create_requisition(redirect_url:, reference:, institution_id:, user_language: "en", agreement: nil)
12
+ def create_requisition(redirect_url:, reference:, institution_id:, user_language: "en", agreement: nil, account_selection: false, redirect_immediate: false)
14
13
  # Create requisition. For creating links and retrieving accounts.
15
14
  payload = {
16
15
  "redirect": redirect_url,
17
16
  "reference": reference,
18
17
  "institution_id": institution_id,
19
18
  "user_language": user_language,
20
- }
19
+ "account_selection": account_selection,
20
+ "redirect_immediate" redirect_immediate
21
+ }
21
22
 
22
23
  if agreement
23
24
  payload["agreement"] = agreement
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nordigen
4
- VERSION = "2.0.1"
4
+ VERSION = "2.1.1"
5
5
  end
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.0.1
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nordigen Solutions
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-09 00:00:00.000000000 Z
11
+ date: 2022-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday