solidus_mp_dois 0.0.7 → 0.0.9

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: d612afa07b8ba401d38482aca50e91bc7e946c28562ac562f5fb8805f94c76d3
4
- data.tar.gz: bf2d2b3c68adbb59e29f7bbec4378364e55f5110adf47c5e3ed6ab0675e0c557
3
+ metadata.gz: 5ebef0dcf722dda6977b818295e2e6c75800a331541350ce6c429a0ed8cdff39
4
+ data.tar.gz: 00c49dc7f47be4986e9d434b728a6a39573e9469b3bd1d4d1ca8dc1de21b4648
5
5
  SHA512:
6
- metadata.gz: 2bb4938f08ea5f136628664a27e7c7ccfce37f392c010ccbeb1fca91124f15421ce73ca82e71a579ab5ea99e64e6b3a35dc31c3d5e67acbb5116f285e5d0647a
7
- data.tar.gz: 576189faad94ba148cc165fbf8be512c733e3b8949e558f211b7111832cfb77e58c67549dddec2b308e9422665e152a6412b67188de61939f8b9be22af4497ae
6
+ metadata.gz: 1189962e09a95c85ab5b710c4a1006ccdf14cdc445d187dde3d77393d9a3f7d86fd1829de9cb43bf2aa40c00018a7e17fc62b30b847e021247fe2a164b38d063
7
+ data.tar.gz: 47611302eb6cbbd2a3c4c607caf6ca716eb2250fda0d8cf724f393e88afd08f456598ae35c8416c8d7a4aa83a878c6d38448f8475f628700ef33db5ea20df8ea
@@ -23,6 +23,8 @@ module SolidusMpDois
23
23
  successful_response("Pagamento cancelado. Se necessário, realize o reembolso.", transaction_id)
24
24
  end
25
25
 
26
+ private
27
+
26
28
  def successful_response message, transaction_id
27
29
  ActiveMerchant::Billing::Response.new(
28
30
  true,
@@ -31,5 +33,12 @@ module SolidusMpDois
31
33
  authorization: transaction_id
32
34
  )
33
35
  end
36
+
37
+ def failure_response message
38
+ ActiveMerchant::Billing::Response.new(
39
+ false,
40
+ message
41
+ )
42
+ end
34
43
  end
35
44
  end
@@ -30,8 +30,8 @@ module SolidusMpDois
30
30
  end
31
31
 
32
32
  def create_payment order
33
- payment = find_existing_payment(order)
34
- return payment if payment_usable?(order, payment)
33
+ existing_payment = find_existing_payment(order)
34
+ return existing_payment if payment_usable?(order, existing_payment)
35
35
 
36
36
  payment = order.payments.new(amount: order.total, payment_method: self)
37
37
  payment.source = init_source(order)
@@ -1,2 +1,5 @@
1
- json.call(payment_source, :id, :external_id, :tax_id, :email, :status, :card_brand, :installments,
2
- :last_four_digits)
1
+ if payment_source.respond_to?(:card_brand)
2
+ json.call(payment_source, :id, :external_id, :tax_id, :email, :status, :card_brand, :installments, :last_four_digits)
3
+ else
4
+ json.call(payment_source, :id, :external_id, :tax_id, :email, :status, :credit_card_brand, :installments, :last_four_digits)
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_mp_dois
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todas Essas Coisas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-11 00:00:00.000000000 Z
11
+ date: 2024-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_brazilian_adaptations