solidus_mp 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/solidus_mp/mp_card.rb +2 -2
- data/app/models/solidus_mp/mp_gateway.rb +22 -0
- data/app/models/solidus_mp/mp_pix.rb +1 -1
- data/lib/solidus_mp/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17e9ca9188ad1dd41968f23f866f23fe7c040fb8d321022a3f54a360443ec7a7
|
4
|
+
data.tar.gz: 1a152a7a74ba1fcf82bb3ff9baba3c384f2ae60dd5f9d081fe4af2ad07ad757a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc8aeb78397d14d8b8e28a614d2a8d70c202cc717a9f6afe874f18dc95f62916f6a608171c403ec1df52292460f6af2c96d580d4e2fde8b4650fa9cbdc3c6874
|
7
|
+
data.tar.gz: e76dbd0ba88a43988f3e51243f8dce9ac6ee987e66f8fdf60dc09bb2088f63162f90d3fd1f3c2e377714c835de68af112fc1d423841d09602a2d579790b81f5b
|
@@ -10,7 +10,7 @@ module SolidusMp
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def gateway_class
|
13
|
-
|
13
|
+
MpGateway
|
14
14
|
end
|
15
15
|
|
16
16
|
# Pra nao dar problema de pagamento pendente
|
@@ -22,7 +22,7 @@ module SolidusMp
|
|
22
22
|
source.is_a?(payment_source_class)
|
23
23
|
end
|
24
24
|
|
25
|
-
def create_card_payment payment, user
|
25
|
+
def create_card_payment payment, user=nil
|
26
26
|
if user
|
27
27
|
customer = find_or_create_customer(payment, user)
|
28
28
|
save_credit_card(payment, customer)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module SolidusMp
|
2
|
+
class MpGateway
|
3
|
+
|
4
|
+
def initialize(options)
|
5
|
+
MpApi.configuration.access_token = options[:access_token]
|
6
|
+
end
|
7
|
+
|
8
|
+
def void(transaction_id, options = {})
|
9
|
+
# Respondendo sempre com successful_response para funcionar o botão de "Cancelar" do pedido. Reembolso deve ser feito por fora.
|
10
|
+
successful_response("Pedido cancelado. Se necessário, realize o reembolso.", transaction_id)
|
11
|
+
end
|
12
|
+
|
13
|
+
def successful_response message, transaction_id
|
14
|
+
ActiveMerchant::Billing::Response.new(
|
15
|
+
true,
|
16
|
+
message,
|
17
|
+
{},
|
18
|
+
authorization: transaction_id
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
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: 1.1.
|
4
|
+
version: 1.1.2
|
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-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- app/models/solidus_mp/card_payment_source.rb
|
95
95
|
- app/models/solidus_mp/customer.rb
|
96
96
|
- app/models/solidus_mp/mp_card.rb
|
97
|
+
- app/models/solidus_mp/mp_gateway.rb
|
97
98
|
- app/models/solidus_mp/mp_pix.rb
|
98
99
|
- app/models/solidus_mp/pix_payment_source.rb
|
99
100
|
- app/views/spree/admin/payments/source_forms/_mercado_pago_card.html.erb
|