solidus_mp 0.3.6 → 0.3.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/mp_card.rb +6 -2
- data/app/models/solidus_mp/mp_pix.rb +2 -1
- data/lib/solidus_mp/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69e3838ad6c5f5d27da3f2c7266283932c81bf507d9e37f72dfa69bd277ad218
|
4
|
+
data.tar.gz: 32b2a6e500cc2a34c09dff7774826764f616ec2796ad303efefe46eea92bc5a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd20d8fdbe4df8097d8214619734f85b4503c1b44383007e7353b11e0710ca80615264e8e9d18d9a62f058a727a029b7d4f988adffe1171cc3906fe8e8f2dcb4
|
7
|
+
data.tar.gz: db3344e41170712201c2fadb1ab00b7a16e7929ee32f8b8093bcd3371e61622f2ca6edf6b2ccef89199858f4b4eea4a4e8c5f77281357ee83ffcdc09339a62f4
|
@@ -13,6 +13,11 @@ module SolidusMp
|
|
13
13
|
"MpCard"
|
14
14
|
end
|
15
15
|
|
16
|
+
# Pra nao dar problema de pagamento pendente
|
17
|
+
def auto_capture?
|
18
|
+
true
|
19
|
+
end
|
20
|
+
|
16
21
|
def supports?(source)
|
17
22
|
source.is_a?(payment_source_class)
|
18
23
|
end
|
@@ -27,7 +32,6 @@ module SolidusMp
|
|
27
32
|
payment.log_entries.create!(parsed_payment_response_details_with_fallback: response)
|
28
33
|
payment.source.update(error_message: mp_payment.error || "Ocorreu um erro ao criar o pagamento.", status: "error")
|
29
34
|
elsif mp_payment.status == "approved"
|
30
|
-
payment.complete
|
31
35
|
payment.source.update(status: "success")
|
32
36
|
elsif mp_payment.status == "pending"
|
33
37
|
payment.source.update(status: "pending")
|
@@ -85,4 +89,4 @@ module SolidusMp
|
|
85
89
|
end
|
86
90
|
|
87
91
|
end
|
88
|
-
end
|
92
|
+
end
|
@@ -37,7 +37,8 @@ module SolidusMp
|
|
37
37
|
|
38
38
|
def create_mp_payment payment
|
39
39
|
MpApi.configuration.access_token = preferences[:access_token]
|
40
|
-
|
40
|
+
identification_type = payment.source.tax_id.length > 14 ? "CNPJ" : "CPF"
|
41
|
+
MpApi::Payment.new(payer_email: payment.source.email, payer_identification_type: identification_type, payment_method: "pix", payer_identification_number: payment.source.tax_id, amount: payment.amount.to_f, statement_descriptor: payment.source.statement_descriptor, description: payment.source.description, items: payment.source.items).create
|
41
42
|
end
|
42
43
|
|
43
44
|
def cancel_payment payment
|
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.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- caio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
|
-
rubygems_version: 3.4.
|
160
|
+
rubygems_version: 3.4.10
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: ''
|