solidus_mp_dois 3.1.0 → 3.1.1

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: 44927e2980c46be7c5cdc7d57931c6e9300d46370f903d265ac906b16c04c094
4
- data.tar.gz: 28533f9624bdfc9225f2cc8131445886fa6bbf5865580d4db7f652b8c5ea8fb9
3
+ metadata.gz: 31c1fd9d84b73ecf99a02020b6a3df8fd9cfe9481279f8a797e1af7f6bf75c0f
4
+ data.tar.gz: 4b637bd61374c0791310473ae02876cb9e8662522907e01419513fb5fa47feb6
5
5
  SHA512:
6
- metadata.gz: 7294f4d3c0d25d3c1e82feebe64853a6c520a97c767b7bebd88128aef7be987b4c78594040c16e188d7707e41797776670e91e97fce3e65773804ff10ec0cff0
7
- data.tar.gz: 9c3d71ee5ad8ab90e6bd9757402f2d8d96b7803614e6a3360601152cceb3f967baa524c35dd915632a900b9387a54700034182b9bfff4b1552312c7a0cde34b6
6
+ metadata.gz: f1313ac13a90bfc70709086ddd1661d9a3ff501c85027ea33d67ccbd1134c64620a7b58ecdac76fe7f3cea50bfe1cbeae867eac049f8f25fd6f5cc6dc0b8b722
7
+ data.tar.gz: 52efd4073bfb6619f735b3d53dd8deaee114f2ed53dc27a105b68dbf6135919c574ebb4ed4794f650c09e95e2fec43692d1caa0ca9bafafc5622b5ade230f681
@@ -0,0 +1,29 @@
1
+ module SolidusMpDois
2
+ class Gateway
3
+ def initialize(options)
4
+ end
5
+
6
+ def void(transaction_id, _options = {})
7
+ # Respondendo sempre com successful_response para funcionar o botão de "Cancelar" do pedido. Reembolso deve ser feito por fora.
8
+ successful_response("Pagamento cancelado. Se necessário, realize o reembolso.", transaction_id)
9
+ end
10
+
11
+ private
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
+
22
+ def failure_response(message)
23
+ ActiveMerchant::Billing::Response.new(
24
+ false,
25
+ message
26
+ )
27
+ end
28
+ end
29
+ end
@@ -8,6 +8,10 @@ module SolidusMpDois
8
8
  CreditCardSource
9
9
  end
10
10
 
11
+ def gateway_class
12
+ Gateway
13
+ end
14
+
11
15
  def supports?(source)
12
16
  source.is_a?(payment_source_class)
13
17
  end
@@ -8,6 +8,10 @@ module SolidusMpDois
8
8
  PixSource
9
9
  end
10
10
 
11
+ def gateway_class
12
+ Gateway
13
+ end
14
+
11
15
  def supports?(source)
12
16
  source.is_a?(payment_source_class)
13
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_mp_dois
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todas Essas Coisas
@@ -48,6 +48,7 @@ files:
48
48
  - app/models/solidus_mp_dois/card.rb
49
49
  - app/models/solidus_mp_dois/credit_card_source.rb
50
50
  - app/models/solidus_mp_dois/customer.rb
51
+ - app/models/solidus_mp_dois/gateway.rb
51
52
  - app/models/solidus_mp_dois/mp_card.rb
52
53
  - app/models/solidus_mp_dois/mp_pix.rb
53
54
  - app/models/solidus_mp_dois/pix_source.rb