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 +4 -4
- data/lib/mp_api/payment_error.rb +1 -2
- data/lib/mp_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48502672bd54cbc042ef54a26dc316c50234c833ab5f31031c1579dcfc6ca653
|
4
|
+
data.tar.gz: 9560c8e8acfb40c240bcbdc177c3d134bed092b9f4b442a22c29d4ff66856db8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bae242985b66501ea05511ba97bf6b79f568058c9cf1771582034270f5b0ad6f064dc6be88f681604a19b8b6416152756b1878b736b59263d9f4cc26ead0c928
|
7
|
+
data.tar.gz: e164962d26a36bbe9be7dba1301e84fcbdbb0637aef1755693d2d66af7ce513d0b9f5a3ddc9a6e940fde823084a797f33047cad973dcf0047af7814c49f7109c
|
data/lib/mp_api/payment_error.rb
CHANGED
@@ -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
|
|
data/lib/mp_api/version.rb
CHANGED