paypro 2.0.0 → 2.1.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 +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -1
- data/Gemfile +3 -3
- data/lib/pay_pro/api_client.rb +16 -6
- data/lib/pay_pro/entities/customer.rb +16 -1
- data/lib/pay_pro/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0564a67b210cd7adbc23d04d6d82bb1dc618fbc7bd8c8916233c5e8301b84509
|
4
|
+
data.tar.gz: bf2048e8ea71ff85b3f24ae91be9a9d946b2640e62bafac150433aba259a4409
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1190b371b19d5cf6bd4eb909be5b718f299bcf006ded6a8c48bb8b4b7f881ca2a33d760db4c13063d63dee87240a02abaf0c89cc2c5efa96bf82ffbb45f54977
|
7
|
+
data.tar.gz: 77bd89f811f21519371c134d79fded8062adb8223765a6a68889e81adfe2c89c310455364d693a5b2c2d67ffa20b3c764d1b0fb55994f7dc99c00017e29a0db3
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -10,9 +10,9 @@ group :development do
|
|
10
10
|
gem 'rake', '~> 12.0'
|
11
11
|
gem 'rspec', '~> 3.0'
|
12
12
|
|
13
|
-
gem 'rubocop', '~> 1.
|
14
|
-
gem 'rubocop-performance', '~> 1.
|
15
|
-
gem 'rubocop-rspec', '~>
|
13
|
+
gem 'rubocop', '~> 1.75.5'
|
14
|
+
gem 'rubocop-performance', '~> 1.25.0'
|
15
|
+
gem 'rubocop-rspec', '~> 3.6.0'
|
16
16
|
|
17
17
|
gem 'timecop', '~> 0.9.8'
|
18
18
|
|
data/lib/pay_pro/api_client.rb
CHANGED
@@ -71,12 +71,7 @@ module PayPro
|
|
71
71
|
|
72
72
|
case pay_pro_response.status
|
73
73
|
when 401
|
74
|
-
raise
|
75
|
-
message: 'Invalid API key supplied. ' \
|
76
|
-
'Make sure to set a correct API key without any whitespace around it. ' \
|
77
|
-
'You can find your API key in the PayPro dashboard at "https://app.paypro.nl/developers/api-keys".',
|
78
|
-
**default_params
|
79
|
-
)
|
74
|
+
raise authentication_error(**default_params)
|
80
75
|
when 404
|
81
76
|
raise ResourceNotFoundError.new(message: 'Resource not found', **default_params)
|
82
77
|
when 422
|
@@ -86,6 +81,12 @@ module PayPro
|
|
86
81
|
code: pay_pro_response.data['error']['type'],
|
87
82
|
**default_params
|
88
83
|
)
|
84
|
+
when 500
|
85
|
+
raise PayPro::Error.new(
|
86
|
+
message: pay_pro_response.data['error']['message'],
|
87
|
+
code: pay_pro_response.data['error']['type'],
|
88
|
+
**default_params
|
89
|
+
)
|
89
90
|
end
|
90
91
|
rescue JSON::ParserError
|
91
92
|
raise PayPro::Error.new(
|
@@ -95,6 +96,15 @@ module PayPro
|
|
95
96
|
)
|
96
97
|
end
|
97
98
|
|
99
|
+
def authentication_error(**default_params)
|
100
|
+
AuthenticationError.new(
|
101
|
+
message: 'Invalid API key supplied. ' \
|
102
|
+
'Make sure to set a correct API key without any whitespace around it. ' \
|
103
|
+
'You can find your API key in the PayPro dashboard at "https://app.paypro.nl/developers/api-keys".',
|
104
|
+
**default_params
|
105
|
+
)
|
106
|
+
end
|
107
|
+
|
98
108
|
def request_headers(api_key)
|
99
109
|
{
|
100
110
|
'Content-Type' => 'application/json',
|
@@ -2,9 +2,24 @@
|
|
2
2
|
|
3
3
|
module PayPro
|
4
4
|
class Customer < Resource
|
5
|
-
include PayPro::Operations::Deletable
|
6
5
|
include PayPro::Operations::Updatable
|
7
6
|
|
8
7
|
RESOURCE_PATH = 'customers'
|
8
|
+
|
9
|
+
def mandates(**options)
|
10
|
+
api_request(
|
11
|
+
method: 'get',
|
12
|
+
uri: "#{resource_url}/mandates",
|
13
|
+
options: options
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
def subscriptions(**options)
|
18
|
+
api_request(
|
19
|
+
method: 'get',
|
20
|
+
uri: "#{resource_url}/subscriptions",
|
21
|
+
options: options
|
22
|
+
)
|
23
|
+
end
|
9
24
|
end
|
10
25
|
end
|
data/lib/pay_pro/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PayPro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|