solidus_mp_dois 0.0.7 → 0.0.8
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/app/models/solidus_mp_dois/mp_gateway.rb +9 -0
- data/app/models/solidus_mp_dois/mp_pix.rb +2 -2
- 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: 80632d9a2c759f03cf46cb691b62c9f6380a8f3de086afc0bac0065dae6798bc
|
4
|
+
data.tar.gz: f2ca611c4acd8111af809827072018f57e04c3e2bbebf5fc9f580e05450ccf70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f1ee67012256432f4dcb026afb340bddb9fce91374c63d28a08b4d701f0f473d1d9d0b8b176a73b66c08ec98f42969628c9603387c0311e913f4b543e16b198
|
7
|
+
data.tar.gz: '094ec31b037a3e266374449e930dc17e98201d043753baa0b485ad219baaa4ab253f5eefbd73f613b521b5087d0b3aa85ae54846df768d06b1cd7c9a9aedd4ee'
|
@@ -23,6 +23,8 @@ module SolidusMpDois
|
|
23
23
|
successful_response("Pagamento cancelado. Se necessário, realize o reembolso.", transaction_id)
|
24
24
|
end
|
25
25
|
|
26
|
+
private
|
27
|
+
|
26
28
|
def successful_response message, transaction_id
|
27
29
|
ActiveMerchant::Billing::Response.new(
|
28
30
|
true,
|
@@ -31,5 +33,12 @@ module SolidusMpDois
|
|
31
33
|
authorization: transaction_id
|
32
34
|
)
|
33
35
|
end
|
36
|
+
|
37
|
+
def failure_response message
|
38
|
+
ActiveMerchant::Billing::Response.new(
|
39
|
+
false,
|
40
|
+
message
|
41
|
+
)
|
42
|
+
end
|
34
43
|
end
|
35
44
|
end
|
@@ -30,8 +30,8 @@ module SolidusMpDois
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def create_payment order
|
33
|
-
|
34
|
-
return
|
33
|
+
existing_payment = find_existing_payment(order)
|
34
|
+
return existing_payment if payment_usable?(order, existing_payment)
|
35
35
|
|
36
36
|
payment = order.payments.new(amount: order.total, payment_method: self)
|
37
37
|
payment.source = init_source(order)
|