solidus_mp 0.1.2 → 0.1.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60eafb1e4726a4c98b649b4505d49c947aa2d5fad8c752a7b9ff5524f91fbf9d
|
4
|
+
data.tar.gz: 89156b56cf14ee3d476fa332443a953927154702a3e8778580650023bd976068
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b71a368326cb3af0cbb360a0628387f74a928a15f0a14433ebc10fecc300cee9dcf4a265abea925ecb5fe4288d9704254791c38d6b345e3f7af754bbc9f3db36
|
7
|
+
data.tar.gz: e8919c63c541944d9dd586c36ea63a5634a7fa90dec84b795dbd60e58f3c18f18b9f137167920010fecf11bdae15cb15ad5879e4f13f00215f5b2cbae093a1f3
|
@@ -22,8 +22,15 @@ module SolidusMp
|
|
22
22
|
MpApi.configuration.access_token = preferences[:access_token]
|
23
23
|
mp_payment = MpApi::Payment.new(amount: payment.amount.to_f, payment_method: payment.source.credit_card_brand, payer_email: payment.source.email, payer_identification_type: payment.source.payer_identification_type, payer_identification_number: payment.source.tax_id, token: payment.source.token, issuer_id: payment.source.issuer_id, installments: payment.source.installments, three_d_secure_mode: true).create
|
24
24
|
payment.source.update(external_id: mp_payment.id, three_ds_url: mp_payment.three_ds_info_external_resource_url, three_ds_creq: mp_payment.three_ds_info_creq)
|
25
|
+
if mp_payment.status == "approved"
|
26
|
+
payment.complete
|
27
|
+
elsif mp_payment.status == "rejected"
|
28
|
+
payment.invalidate
|
29
|
+
end
|
25
30
|
rescue MpApi::TooManyRequestsError
|
26
31
|
payment.invalidate
|
32
|
+
rescue MpApi::RequestError
|
33
|
+
payment.invalidate
|
27
34
|
end
|
28
35
|
end
|
29
36
|
|
@@ -24,6 +24,8 @@ module SolidusMp
|
|
24
24
|
payment.source.update(external_id: mp_payment.id, qr_code: mp_payment.qr_code, qr_code_base64: mp_payment.qr_code_base_64, ticket_url: mp_payment.ticket_url)
|
25
25
|
rescue MpApi::TooManyRequestsError
|
26
26
|
payment.invalidate
|
27
|
+
rescue MpApi::RequestError
|
28
|
+
payment.invalidate
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
@@ -1,2 +1,2 @@
|
|
1
|
-
<input type="text" name="payment_source[<%=payment_method.id%>][tax_id]" placeholder="CPF">
|
2
|
-
<input type="text" name="payment_source[<%=payment_method.id%>][email]" placeholder="E-mail">
|
1
|
+
<input type="text" name="payment_source[<%=payment_method.id%>][tax_id]" placeholder="CPF" class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-300 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6">
|
2
|
+
<input type="text" name="payment_source[<%=payment_method.id%>][email]" placeholder="E-mail" class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-300 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6">
|
data/lib/solidus_mp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_mp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- caio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|