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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a0d0a12e6c7919205dcbf772d5166d5536f33b90375c1f7c0b06f81df3b0db6
4
- data.tar.gz: 51230aee3d7846768b29df33365f8aaa0f1b4c283a3a924d2a8d3e50544bcd60
3
+ metadata.gz: 17e9ca9188ad1dd41968f23f866f23fe7c040fb8d321022a3f54a360443ec7a7
4
+ data.tar.gz: 1a152a7a74ba1fcf82bb3ff9baba3c384f2ae60dd5f9d081fe4af2ad07ad757a
5
5
  SHA512:
6
- metadata.gz: 144d042e10f881f3df08ab85710ead0c23330042ed435bcc19be3237ec7fd75cce4a78a698e9f23f39d4b9c4a91601e782a7d2ca35d375a78988da2e9750b36b
7
- data.tar.gz: d4d08f6d1b79592acb31ff5ad1b1bfb44a0b0456be7f5b58bebf0effa2a838cbeb6c8734e8ffa9caae6dff67b17f98de949916d40c86ff5e98af2599597e6b3a
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
- "MpCard"
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
@@ -10,7 +10,7 @@ module SolidusMp
10
10
  end
11
11
 
12
12
  def gateway_class
13
- "MpPix"
13
+ MpGateway
14
14
  end
15
15
 
16
16
  def supports?(source)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusMp
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.2'
5
5
  end
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.0
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-07-15 00:00:00.000000000 Z
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