mp_api 0.3.8 → 0.3.9

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: 70b974d39a2f32b20eaf5ab1d1e71a808aee9727de3b440cbcaca6155b70b8be
4
- data.tar.gz: 652c07eda8d6f6a2d246b86a0a95ccf5b564d28c7f4a02f253d849690f9cbaf3
3
+ metadata.gz: 48502672bd54cbc042ef54a26dc316c50234c833ab5f31031c1579dcfc6ca653
4
+ data.tar.gz: 9560c8e8acfb40c240bcbdc177c3d134bed092b9f4b442a22c29d4ff66856db8
5
5
  SHA512:
6
- metadata.gz: 21a90e4578f235b1c22fe19a83b2058b54c8d5d08376be73f67cb82ae7817a7c3fcb8b70cf61135eb8a440932ddc2aea916acb5802fe8d72ec21a10d9120813c
7
- data.tar.gz: 2711a21679e9a2f34c25b88acf1dbf3e446267906ba9bf079d408e8d039c8a0d977674e1f8f4fe39c971cc1770883749c80492aea58feaee9f483204bf4ce5af
6
+ metadata.gz: bae242985b66501ea05511ba97bf6b79f568058c9cf1771582034270f5b0ad6f064dc6be88f681604a19b8b6416152756b1878b736b59263d9f4cc26ead0c928
7
+ data.tar.gz: e164962d26a36bbe9be7dba1301e84fcbdbb0637aef1755693d2d66af7ce513d0b9f5a3ddc9a6e940fde823084a797f33047cad973dcf0047af7814c49f7109c
@@ -6,6 +6,7 @@ module MpApi
6
6
  end
7
7
 
8
8
  def error
9
+ return nil unless json_response["error"] || ["rejected"].include?(json_response["status"])
9
10
  rejected_payment_error || failed_payment_error || "Pagamento recusado."
10
11
  end
11
12
 
@@ -17,12 +18,10 @@ module MpApi
17
18
  private
18
19
 
19
20
  def rejected_payment_error
20
- return nil unless ["rejected"].include?(json_response["status"])
21
21
  message_by_status_detail(json_response["status_detail"])
22
22
  end
23
23
 
24
24
  def failed_payment_error
25
- return nil unless json_response["error"]
26
25
  message_by_error_message(json_response["cause"]&.first["description"])
27
26
  end
28
27
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MpApi
4
- VERSION = "0.3.8"
4
+ VERSION = "0.3.9"
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.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - caio