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 +4 -4
- data/CHANGELOG.md +3 -2
- data/lib/mangopay.rb +17 -4
- data/lib/mangopay/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da86f380ab29a146392b6ba79b5d5518f9dc898c5a22abadfbdfc1e3a93443bc
|
4
|
+
data.tar.gz: 6a938c0de24f0018ae2c6f0ab4f52ef01334f73a6131aea02b1d5affff317540
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 112d5afb9ec05f57cf718598c4aebb92f0d5bb68e2647c49706c598e0a98b983067b023a78e7b78075951a160f23fb21c3e033b66c41de03cfe6676867d8276c
|
7
|
+
data.tar.gz: fd0b5fe4b3be196ca0969d8be3c71308b532d64f6d0710f8a2b379e797a0c05d648c8cdce1719f4d51bcfa7c7641324a418b877d5864e732974f1b65ab4706a7
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
## [
|
2
|
-
|
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
|
data/lib/mangopay.rb
CHANGED
@@ -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' => "
|
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 {
|
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
|
-
|
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
|
data/lib/mangopay/version.rb
CHANGED
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.
|
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-
|
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
|
-
|
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
|