mangopay 3.0.34 → 3.0.35

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: cb254e350875d634519586fc4e451a4c83148886522287f266ed1306131235b4
4
- data.tar.gz: ef04474a28bf48dbef09cb20cf48375fdac3183546d30631b1f443aa0f9f21b8
3
+ metadata.gz: da86f380ab29a146392b6ba79b5d5518f9dc898c5a22abadfbdfc1e3a93443bc
4
+ data.tar.gz: 6a938c0de24f0018ae2c6f0ab4f52ef01334f73a6131aea02b1d5affff317540
5
5
  SHA512:
6
- metadata.gz: c8ddc8e015f6ffe95c3947f063a2736a9863b19cf24a02d389fa00d9b9f623c27e083468e7c6eb9d2fcde31a974d3cb73da2674e76b09f53a14b80aaf6c59ca4
7
- data.tar.gz: 49ce455ede60281e5c6b430c2c722d7c0c0f3abcc15204beaedd8c3954621d8f0057f05493ebd47df84f02cb91ea0d63db4e247b984f28091edcb525326b7158
6
+ metadata.gz: 112d5afb9ec05f57cf718598c4aebb92f0d5bb68e2647c49706c598e0a98b983067b023a78e7b78075951a160f23fb21c3e033b66c41de03cfe6676867d8276c
7
+ data.tar.gz: fd0b5fe4b3be196ca0969d8be3c71308b532d64f6d0710f8a2b379e797a0c05d648c8cdce1719f4d51bcfa7c7641324a418b877d5864e732974f1b65ab4706a7
@@ -1,5 +1,6 @@
1
- ## [Unreleased]
2
- - New v4 SDK version (available as a beta version here: https://rubygems.org/gems/mangopay-v4) - will be shortly merged on master.
1
+ ## [3.0.35] - 2020-08-24
2
+ -> Improvement to Net::ReadTimeout handling
3
+ -> "User-agent" format in the headers changed, aligned to other assets 👤
3
4
 
4
5
  ## [3.0.34] - 2020-06-25
5
6
  ### Added
@@ -142,6 +142,8 @@ module MangoPay
142
142
  do_request(http, req, uri)
143
143
  end
144
144
 
145
+ raise MangoPay::ResponseError.new(uri, '408', {'Message' => 'Request Timeout'}) if res.nil?
146
+
145
147
  # decode json data
146
148
  data = res.body.to_s.empty? ? {} : JSON.load(res.body.to_s)
147
149
 
@@ -193,7 +195,7 @@ module MangoPay
193
195
  def request_headers
194
196
  auth_token = AuthorizationToken::Manager.get_token
195
197
  headers = {
196
- 'User-Agent' => "MANGOPAY V2 RubyBindings/#{VERSION}",
198
+ 'User-Agent' => "MangoPay V2 SDK Ruby Bindings #{VERSION}",
197
199
  'Authorization' => "#{auth_token['token_type']} #{auth_token['access_token']}",
198
200
  'Content-Type' => 'application/json'
199
201
  }
@@ -217,12 +219,23 @@ module MangoPay
217
219
  params = FilterParameters.request(req.body)
218
220
  line = "[#{Time.now.iso8601}] #{req.method.upcase} \"#{uri.to_s}\" #{params}"
219
221
  begin
220
- time = Benchmark.realtime { res = do_request_without_log(http, req) }
222
+ time = Benchmark.realtime {
223
+ begin
224
+ res = do_request_without_log(http, req)
225
+ rescue Net::ReadTimeout
226
+ res = nil
227
+ end
228
+ }
221
229
  res
222
230
  ensure
223
- params = FilterParameters.response(res.body)
224
231
  line = "#{log_severity(res)} #{line}"
225
- line += "\n [#{(time * 1000).round(1)}ms] #{res.code} #{params}\n"
232
+ if res.nil?
233
+ params = ''
234
+ line += "\n [#{(time * 1000).round(1)}ms] 408 Request Timeout #{params}\n"
235
+ else
236
+ params = FilterParameters.response(res.body)
237
+ line += "\n [#{(time * 1000).round(1)}ms] #{res.code} #{params}\n"
238
+ end
226
239
  logger.info { line }
227
240
  end
228
241
  end
@@ -1,3 +1,3 @@
1
1
  module MangoPay
2
- VERSION = '3.0.34'
2
+ VERSION = '3.0.35'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mangopay
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.34
4
+ version: 3.0.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoffroy Lorieux
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-06-25 00:00:00.000000000 Z
12
+ date: 2020-08-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -165,8 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  requirements: []
168
- rubyforge_project:
169
- rubygems_version: 2.7.7
168
+ rubygems_version: 3.0.8
170
169
  signing_key:
171
170
  specification_version: 4
172
171
  summary: Ruby bindings for the version 2 of the MANGOPAY API