afterbanks-psd2-api-ruby 0.1.0 → 0.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: 74a77be49119cc3b5c78ebcdb319db8f2fb0dc240d9c7374c5a65bfeee4086ca
4
- data.tar.gz: 75d2475c8af58adfb6cf21954057a7076f8367da1b31f9dc0315fa0e05e79d72
3
+ metadata.gz: a5333c37b68c65f7b12b555ed75064978c88ee4d3380af54fedc13614e1f1bb7
4
+ data.tar.gz: 3998c922e7ee79e9d8703167af776937b9b9f234c643f068ada329b920a7108b
5
5
  SHA512:
6
- metadata.gz: f8978cabe120ef0cdfc65618af4515587f2120c6c0272e0deeffee291f1c0f87a3b25e78079bdc8075594205cc408c83485372361895178596a94f2d6c058cd1
7
- data.tar.gz: 6b01263e08c321231c7e93111e1752ab9dc4e20b36d45018f35238a59c9bd0cfb90a04ee59160abbd3b531b12b3857010c2dd807d9bf1d103c58c1b162fb56de
6
+ metadata.gz: 2b6742ee7c034247cc95bc180a5b4a3ef9efb7dfa307a6a5231bcb1e1f090b481ba8876465682d86911aca28e127cc69ecdb3ca97fe8df96d596d97783efdef0
7
+ data.tar.gz: 68e7f7711141f4e88be67a669cb0e8ab42790166d6e0572666932a659448e51c51423793ac077843606589060a42edd33342cde657e0aed690d673d661fcf7f5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- afterbanks-psd2-api-ruby (0.1.0)
4
+ afterbanks-psd2-api-ruby (0.1.1)
5
5
  rest-client (~> 2.0.2)
6
6
 
7
7
  GEM
@@ -13,14 +13,13 @@ GEM
13
13
  crack (0.4.3)
14
14
  safe_yaml (~> 1.0.0)
15
15
  diff-lcs (1.3)
16
- domain_name (0.5.20190701)
17
- unf (>= 0.0.5, < 1.0.0)
16
+ domain_name (0.6.20240107)
18
17
  hashdiff (1.0.1)
19
- http-cookie (1.0.3)
18
+ http-cookie (1.0.5)
20
19
  domain_name (~> 0.5)
21
- mime-types (3.3.1)
20
+ mime-types (3.5.2)
22
21
  mime-types-data (~> 3.2015)
23
- mime-types-data (3.2020.1104)
22
+ mime-types-data (3.2024.0305)
24
23
  netrc (0.11.0)
25
24
  parallel (1.19.1)
26
25
  parser (3.0.0.0)
@@ -64,9 +63,6 @@ GEM
64
63
  ruby-progressbar (1.10.1)
65
64
  safe_yaml (1.0.5)
66
65
  timecop (0.9.2)
67
- unf (0.1.4)
68
- unf_ext
69
- unf_ext (0.0.7.7)
70
66
  unicode-display_width (1.6.0)
71
67
  webmock (3.8.3)
72
68
  addressable (>= 2.3.6)
data/README.md CHANGED
@@ -33,6 +33,7 @@ You can set a `logger` as well.
33
33
  Changelog
34
34
  ---------
35
35
 
36
+ * 0.1.1 Fix options parameters to ensure not null and check other parameters on Transaction.list
36
37
  * 0.1.0 First full version, including resource wrapping (banks, user, accounts, transactions), error coverage and support for logging
37
38
 
38
39
  TODO
@@ -12,6 +12,8 @@ module AfterbanksPSD2
12
12
  end
13
13
 
14
14
  def api_call(method:, path:, params: {}, options: {})
15
+ options = {} if options.nil?
16
+
15
17
  api_url = ENV['AFTERBANKS_API_URL'] || 'https://apipsd2.afterbanks.com'
16
18
  url = api_url + path
17
19
 
@@ -10,6 +10,12 @@ module AfterbanksPSD2
10
10
  account: { type: :afterbankspsd2_account }
11
11
 
12
12
  def self.list(token:, products:, start_date:)
13
+ raise ArgumentError, "Token is missing" if token.nil? || token.empty?
14
+ raise ArgumentError, "Products must be a string" unless products.is_a?(String)
15
+ raise ArgumentError, "Products is missing" if products.nil? || products.empty?
16
+ raise ArgumentError, "Start date is missing" if start_date.nil? || products.empty?
17
+ raise ArgumentError, "Start date must be a Date" unless start_date.is_a?(Date)
18
+
13
19
  params = {
14
20
  servicekey: AfterbanksPSD2.configuration.servicekey,
15
21
  token: token,
@@ -17,6 +23,8 @@ module AfterbanksPSD2
17
23
  startDate: start_date.strftime("%d-%m-%Y")
18
24
  }
19
25
 
26
+ options = {}
27
+
20
28
  # if the start_date is older than 90 days, we need to increase timeout to 2 hours
21
29
  if start_date < Date.today << 3
22
30
  options = {
@@ -46,7 +54,7 @@ module AfterbanksPSD2
46
54
 
47
55
  def self.transactions_information_for(response:, products:)
48
56
  transactions_information = []
49
- products_array = products.split(",")
57
+ products_array = products.to_s.split(",").map(&:strip)
50
58
 
51
59
  response.each do |account_information|
52
60
  product = account_information['product']
@@ -1,3 +1,3 @@
1
1
  module AfterbanksPSD2
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: afterbanks-psd2-api-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florent Lemaitre
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-14 00:00:00.000000000 Z
11
+ date: 2024-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client