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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 788c5ad731e55c5c113f9164ebc22f9e61f2a8305d6c1966c280dada3c8e6a6b
4
- data.tar.gz: abef159ec4a3085da78f4d201fbd46ea699507f4745076ded703aec253e6d942
3
+ metadata.gz: 25bbc0e3b8f592463032d3bb549647a6a6d8f49489b11d303bc9027e8422b4af
4
+ data.tar.gz: b4f29ee32c428589423a1c199c41b969743089bf15a0f7d97e02a7ffb913a933
5
5
  SHA512:
6
- metadata.gz: c0f4292cb63bf270a72380fa88e19ce7746bacb3ea915d0fdfb681127d588d7b3c54aefa37a2384ca441f81cb088efdee9c58d86a868fd9f212a472137bb0005
7
- data.tar.gz: 3b4feba9f139ec060777e397dc9c57e6517b44d1daff2a5601b305e7198c236507be21d169ca6b8b0320cae76d35c7bde27ca781a5e21f574e5ca9f25846d61e
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.json['id']
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.json['id']
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.json['id']
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.json['id']
49
+ ![500, 429].include?(response.code) || response['id']
50
50
  end
51
51
  response.json
52
52
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MpApi
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.8"
5
5
  end
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.7
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.6
67
+ rubygems_version: 3.4.19
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: ''