afterbanks-api-ruby 0.4.0 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22ea53955debb94c87dcb7534c8be33518ec8e1e4800794e53fd871fdc819dac
4
- data.tar.gz: af6ea1904f773515c156c8af3d920b683ea207d6432c5bfda4b729aa81f9d199
3
+ metadata.gz: 97e68524e95b920db99af549d1bc1d92a998eab0542cc14bbc6f05665ab3f7d6
4
+ data.tar.gz: e251c7982023ddab6732ee3b55590c027af3016aa91e3508affd1ae1f2a06a53
5
5
  SHA512:
6
- metadata.gz: 9b890219799117cee50690a67c9ead8b49f14b84a40b36d569c62847a91683a0d5d0d929ac9536f3ac07d0531d7b31d98709cc0273032360c2733c34f34430d5
7
- data.tar.gz: 8e975d6acef0726e98d7245ed0f40e40a4c7e56bf12f91ca6ec7092122446eb84eb515428c28408d2231872a26695d7d68c6c2677203146c9db59f67a2952694
6
+ metadata.gz: 10e9039b45293ec28ce409e430c502d93ea943bbbd9395e8201c17d9c94dc6be0eafdb477168eda0b68a1df2bd11e56b7cbd8ceb55e0dbc66f0b3903a9d6b864
7
+ data.tar.gz: 0d26f45dba3d796355d09e55e988c88e006c2827b3d1e09bfc91689450144de192c62b89b649740374fe113860b03fc2f5b96b4f31c488d343a72296487830a2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- afterbanks-api-ruby (0.4.0)
4
+ afterbanks-api-ruby (0.4.2)
5
5
  rest-client (~> 2.0.2)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -33,6 +33,8 @@ You can set a `logger` as well.
33
33
  Changelog
34
34
  ---------
35
35
 
36
+ * v.0.4.2 Include longCode attribute to the Afterbanks::Error class
37
+ * v.0.4.1 Increased timeout from 5min to 15min
36
38
  * v.0.4.0 Add new, opt-in error for missing product, and several internal improvements
37
39
  * v.0.3.4 Security: upgrade addressable from 2.7.0 to 2.8.0
38
40
  * v.0.3.3 Transaction and Account are compatible with account ID
@@ -14,8 +14,9 @@ module Afterbanks
14
14
  def api_call(method:, path:, params: {})
15
15
  url = 'https://api.afterbanks.com' + path
16
16
 
17
- # Timeout is set to 5min: some banks take a lot to respond (e.g. ING Direct)
18
- request_params = { method: method, url: url, timeout: 60 * 5 }
17
+ # Timeout is set to 15min: some banks take a lot to respond
18
+ # (e.g. ING Direct or CaixaBank in some cases)
19
+ request_params = { method: method, url: url, timeout: 60 * 15 }
19
20
 
20
21
  if method == :post
21
22
  request_params.merge!(payload: params)
@@ -84,11 +85,16 @@ module Afterbanks
84
85
  return unless response_body.is_a?(Hash)
85
86
 
86
87
  code = response_body['code']
88
+ long_code = response_body['longCode']
87
89
  message = response_body['message']
88
90
  additional_info = response_body['additional_info']
89
91
 
90
92
  error_info = { message: message, debug_id: debug_id }
91
93
 
94
+ if !long_code.nil?
95
+ error_info[:long_code] = long_code
96
+ end
97
+
92
98
  case code
93
99
  when 1
94
100
  raise GenericError.new(**error_info)
@@ -1,10 +1,11 @@
1
1
  module Afterbanks
2
2
  class Error < ::StandardError
3
- attr_reader :message, :debug_id, :additional_info
3
+ attr_reader :message, :debug_id, :long_code, :additional_info
4
4
 
5
- def initialize(message:, debug_id:, additional_info: nil)
5
+ def initialize(message:, debug_id:, long_code: nil, additional_info: nil)
6
6
  @message = message
7
7
  @debug_id = debug_id
8
+ @long_code = long_code
8
9
  @additional_info = additional_info
9
10
  end
10
11
 
@@ -1,3 +1,3 @@
1
1
  module Afterbanks
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: afterbanks-api-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Albert Bellonch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-30 00:00:00.000000000 Z
11
+ date: 2023-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client