gocardless_pro 4.20.1 → 4.21.0

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: 3d609bad8f5a7b85cf05639093c346966b16df40a2519f44409900ee60a4ad40
4
- data.tar.gz: 42bddbcb2b62a5053333d60051b3bd3323267e5f45f98ebc89f795ce24e8ed33
3
+ metadata.gz: 70bf421df9a5853c67ad88288ab8d51f0f9e5db1ec23ec09ac9ecd5af4caba30
4
+ data.tar.gz: 3a81c352482231d314162b34c72dc78650e98d671c8d62ccb2144dfdacece566
5
5
  SHA512:
6
- metadata.gz: 36a5335fdd6fbe2674d449e53ddc6e759739dd361c0fa21754c02b175a98867051be8d3d70038a4e6df8334038d4a27ac093aa911969a11ec054c461c7e6cf76
7
- data.tar.gz: 1d1047507f809cf172b6ef1c3bd14971076bb5680eebf8d842c1d9cab9cba29a55cdbd5ee80ba7a7ffb35e8044125805402b37b7cbe65836327dcd169879c8b3
6
+ metadata.gz: b712860ea4fbddecfe948d3aae14783f2d709a7c1014456e509b6292a52db264469cd3df35d6efd005c090832adeeca482944fc4c4d18b58041c36ec6b4dfcc7
7
+ data.tar.gz: df867153918273531b4edd0b889382c46a713751a20ef037c4cdea6a81dc96097bab41784103057458dccc0ffcf38b6057dbe1ed9d2480f681deade492d86634
data/README.md CHANGED
@@ -192,7 +192,7 @@ end
192
192
 
193
193
  If the client is unable to connect to GoCardless, an appropriate exception will be raised, for example:
194
194
 
195
- * `Faraday::TimeoutError`, in case of a timeout
195
+ * `Faraday::TimeoutError`, in case of a timeout (requests time out after 60 seconds by default; change this with the `connection_options` client option, e.g. `connection_options: { request: { timeout: 10 } }`)
196
196
  * `Faraday::ConnectionFailed`, in case of a connection issue (e.g. problems with DNS resolution)
197
197
  * `GoCardlessPro::ApiError`, for `5xx` errors returned from our infrastructure, but not by the API itself
198
198
 
@@ -9,6 +9,9 @@ require 'base64'
9
9
  module GoCardlessPro
10
10
  # GoCardless API
11
11
  class ApiService
12
+ # Seconds to wait for a response when `connection_options` doesn't set `request: { timeout: ... }`
13
+ DEFAULT_TIMEOUT = 60
14
+
12
15
  attr_reader :on_idempotency_conflict
13
16
 
14
17
  # Initialize an APIService
@@ -22,8 +25,9 @@ module GoCardlessPro
22
25
  root_url, @path_prefix = unpack_url(url)
23
26
  http_adapter = options[:http_adapter] || [:net_http]
24
27
  connection_options = options.fetch(:connection_options, {})
28
+ request_options = { timeout: DEFAULT_TIMEOUT }.merge(connection_options.fetch(:request, {}))
25
29
 
26
- @connection = Faraday.new(root_url, connection_options) do |faraday|
30
+ @connection = Faraday.new(root_url, connection_options.merge(request: request_options)) do |faraday|
27
31
  faraday.response :raise_gocardless_errors
28
32
 
29
33
  faraday.adapter(*http_adapter)
@@ -239,7 +239,7 @@ module GoCardlessPro
239
239
  # @option options [Symbol] :environment the environment to connect to - one of `:live` or `:sandbox`.
240
240
  # @option options [Symbol] :access_token the API token
241
241
  # @option options [Symbol] :url the full URL used to make requests to. If you specify this, it will be used over the `environment` option.
242
- # @option options [Symbol] :connection_options `Faraday` connection options hash, e.g. `{ request: { timeout: 3 } }`.
242
+ # @option options [Symbol] :connection_options `Faraday` connection options hash, e.g. `{ request: { timeout: 3 } }`. Requests time out after 60 seconds unless `request: { timeout: ... }` is set.
243
243
  # @return [Client] A client configured to use the API with HTTP Basic
244
244
  # authentication.
245
245
  #
@@ -283,7 +283,7 @@ module GoCardlessPro
283
283
  'User-Agent' => "#{user_agent}",
284
284
  'Content-Type' => 'application/json',
285
285
  'GoCardless-Client-Library' => 'gocardless-pro-ruby',
286
- 'GoCardless-Client-Version' => '4.20.1',
286
+ 'GoCardless-Client-Version' => '4.21.0',
287
287
  },
288
288
  }
289
289
  end
@@ -3,5 +3,5 @@ end
3
3
 
4
4
  module GoCardlessPro
5
5
  # Current version of the GC gem
6
- VERSION = '4.20.1'
6
+ VERSION = '4.21.0'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gocardless_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.20.1
4
+ version: 4.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
@@ -63,28 +63,28 @@ dependencies:
63
63
  requirements:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: 3.26.3
66
+ version: 3.32.0
67
67
  type: :development
68
68
  prerelease: false
69
69
  version_requirements: !ruby/object:Gem::Requirement
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: 3.26.3
73
+ version: 3.32.0
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: rubocop
76
76
  requirement: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: 1.89.0
80
+ version: 1.92.0
81
81
  type: :development
82
82
  prerelease: false
83
83
  version_requirements: !ruby/object:Gem::Requirement
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: 1.89.0
87
+ version: 1.92.0
88
88
  - !ruby/object:Gem::Dependency
89
89
  name: yard
90
90
  requirement: !ruby/object:Gem::Requirement