mp_api 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mp_api/client.rb +5 -5
- data/lib/mp_api/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: 25bbc0e3b8f592463032d3bb549647a6a6d8f49489b11d303bc9027e8422b4af
|
4
|
+
data.tar.gz: b4f29ee32c428589423a1c199c41b969743089bf15a0f7d97e02a7ffb913a933
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8033add8df41e4c1b8200657926ec9c080801c29861fe039d4e83c886298a2e1fbd70c3e9740cb0374f52a613aa42a52be880d2fb53c0f42d73c637ba37e26c1
|
7
|
+
data.tar.gz: a472148d5368e384d2025e80e4498841f3175a33e1bc5486ebfec309d2789717bf27f636f1e2592f62454e10c2789456e54be201ccce232307d9d0d4e725ba7e
|
data/lib/mp_api/client.rb
CHANGED
@@ -14,7 +14,7 @@ module MpApi
|
|
14
14
|
def create_payment(body)
|
15
15
|
response = post("/payments", body: body, headers: @headers) do |response|
|
16
16
|
p response.json unless response.success?
|
17
|
-
response.
|
17
|
+
![500, 429].include?(response.code) || response['id']
|
18
18
|
end
|
19
19
|
response.json
|
20
20
|
end
|
@@ -22,7 +22,7 @@ module MpApi
|
|
22
22
|
def get_payment(payment_id)
|
23
23
|
response = get("/payments/#{payment_id}") do |response|
|
24
24
|
p response.json unless response.success?
|
25
|
-
response.
|
25
|
+
![500, 429].include?(response.code) || response['id']
|
26
26
|
end
|
27
27
|
response.json
|
28
28
|
end
|
@@ -30,7 +30,7 @@ module MpApi
|
|
30
30
|
def create_token(card_token_data)
|
31
31
|
response = post("/card_tokens", body: card_token_data, headers: @headers) do |response|
|
32
32
|
p response.json unless response.success?
|
33
|
-
response.
|
33
|
+
![500, 429].include?(response.code) || response['id']
|
34
34
|
end
|
35
35
|
response.json
|
36
36
|
end
|
@@ -38,7 +38,7 @@ module MpApi
|
|
38
38
|
def search_payment_methods(query)
|
39
39
|
response = get("/payment_methods/search", params: query) do |response|
|
40
40
|
p response.json unless response.success?
|
41
|
-
response.json['results'][0]
|
41
|
+
![500, 429].include?(response.code) || response.json['results'][0]
|
42
42
|
end
|
43
43
|
response.json
|
44
44
|
end
|
@@ -46,7 +46,7 @@ module MpApi
|
|
46
46
|
def get_payment_methods
|
47
47
|
response = get("/payment_methods") do |response|
|
48
48
|
p response.json unless response.success?
|
49
|
-
response.
|
49
|
+
![500, 429].include?(response.code) || response['id']
|
50
50
|
end
|
51
51
|
response.json
|
52
52
|
end
|
data/lib/mp_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mp_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- caio
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
|
-
rubygems_version: 3.4.
|
67
|
+
rubygems_version: 3.4.19
|
68
68
|
signing_key:
|
69
69
|
specification_version: 4
|
70
70
|
summary: ''
|