paypal-rest 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/paypal/rest/version.rb +1 -1
- data/lib/paypal/rest.rb +21 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06b8fc77627f76f8ce2f95ff373a9c4f8fb17670e3f0a097887998761eec117a
|
4
|
+
data.tar.gz: 67d2ab3a15577fbca1da0875464ff150df86363c429b50f39a3d57e1690b0ec3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3caca7697df2acc86f529657574f0184c0422be027800130e04af9d7059bc75a9d53d11e3227991bc2af540787498f2337df031a3c03608170b55673cc74ae0
|
7
|
+
data.tar.gz: abf42d139b20768e5cb8d7b64756593793dfda303c0af00ea6d946b58870cfba7640695baf7bf38f474d080c2ef4d14d432701f97bb8cf6a02a2d9a07d3fc41c
|
data/Gemfile.lock
CHANGED
data/lib/paypal/rest/version.rb
CHANGED
data/lib/paypal/rest.rb
CHANGED
@@ -46,11 +46,22 @@ module Paypal
|
|
46
46
|
|
47
47
|
private
|
48
48
|
|
49
|
+
def get(path)
|
50
|
+
request do |connection|
|
51
|
+
connection.get(path)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
49
55
|
def post(path, params: {}, headers: {})
|
50
|
-
|
56
|
+
request do |connection|
|
57
|
+
connection.post(path, params, headers)
|
58
|
+
end
|
59
|
+
end
|
51
60
|
|
52
|
-
|
61
|
+
def request
|
62
|
+
reset_connection if @bearer_token&.expired?
|
53
63
|
|
64
|
+
response = yield(connection).body
|
54
65
|
response = JSON.parse(response) if response.is_a?(String)
|
55
66
|
response = Util.deep_symbolize_keys(response)
|
56
67
|
|
@@ -58,8 +69,8 @@ module Paypal
|
|
58
69
|
|
59
70
|
response
|
60
71
|
rescue JSON::ParserError, Faraday::ClientError => e
|
61
|
-
|
62
|
-
|
72
|
+
logger.debug(["#{self.class} - #{e.class}: #{e.message}", e.backtrace].join($INPUT_RECORD_SEPARATOR))
|
73
|
+
raise ClientError, e.message
|
63
74
|
end
|
64
75
|
|
65
76
|
def connection
|
@@ -76,6 +87,12 @@ module Paypal
|
|
76
87
|
|
77
88
|
@bearer_token = BearerToken.new
|
78
89
|
end
|
90
|
+
|
91
|
+
def logger
|
92
|
+
configuration.logger
|
93
|
+
end
|
94
|
+
|
95
|
+
class ClientError < StandardError; end
|
79
96
|
end
|
80
97
|
end
|
81
98
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypal-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliot Crosby-McCullough
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -76,7 +76,7 @@ metadata:
|
|
76
76
|
allowed_push_host: https://rubygems.org
|
77
77
|
homepage_uri: https://github.com/SmartCasual/paypal-rest
|
78
78
|
source_code_uri: https://github.com/SmartCasual/paypal-rest
|
79
|
-
changelog_uri: https://github.com/SmartCasual/paypal-rest/blob/1.1.
|
79
|
+
changelog_uri: https://github.com/SmartCasual/paypal-rest/blob/1.1.1/CHANGELOG.md
|
80
80
|
rubygems_mfa_required: 'true'
|
81
81
|
post_install_message:
|
82
82
|
rdoc_options: []
|