solidus_inter 1.1.1 → 1.2.0

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: 9f8527b4fe113c48cde458b6dd290795d126c040c52f1f4f591010017b2e1f10
4
- data.tar.gz: 95d4f66b4f3df7d7bda6198c300c31d2afd928cc6ccb1f71e06c8aed5fc611cc
3
+ metadata.gz: 7aa0fdda876bf2dd7b36faa4f0ee3de9e37846e83f234efc222f935d89831417
4
+ data.tar.gz: 25d93553c05adf4a56fad8ca46ac5eb5a98966daceed65a222572589e5c9eaae
5
5
  SHA512:
6
- metadata.gz: 83b9e1a62a7b57e7b4dd1e81bda915d0dfd816c18e7aea34a7a777830bf009f7f7609b948635aef92c4534309f010669b8554b9c1b6137e00149ac2e4f85beca
7
- data.tar.gz: 9f51b1ad2e8014ec45168b7700655c8177849688183a590ef3351bf00c27f40b66a14f3afe52b1c9cac03f63554e0c3bbff8bef00602c6ff47481ab85b178628
6
+ metadata.gz: 4df48e93c2cd5df49a9e14d309bf8320a6f8af512a24f4e9745cb2a32fc457992214b7184ca631d034515864d4ec91b10e65212c23be82410fca7941b7bba60b
7
+ data.tar.gz: 0c37bd2d1bb18d24609d29fa90d4e56815570a068442b62c0e66e7a418ade329482d1c054e23cc932abad31bed630477e64a9afe6b25d0bde325b25388ce032d
@@ -0,0 +1,20 @@
1
+ module SolidusInter
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("Pedido cancelado. Se necessário, realize o reembolso.", transaction_id)
9
+ end
10
+
11
+ def successful_response message, transaction_id
12
+ ActiveMerchant::Billing::Response.new(
13
+ true,
14
+ message,
15
+ {},
16
+ authorization: transaction_id
17
+ )
18
+ end
19
+ end
20
+ end
@@ -12,7 +12,7 @@ module SolidusInter
12
12
  end
13
13
 
14
14
  def gateway_class
15
- InterPix
15
+ Gateway
16
16
  end
17
17
 
18
18
  def supports?(source)
@@ -1 +1,64 @@
1
- ID do pagamento: <%= payment.source.txid %>
1
+ <div class="content-wrapper">
2
+ <fieldset class="no-border-top">
3
+ <legend>
4
+ Pagamento Inter Pix
5
+ </legend>
6
+ <div class="row">
7
+ <div class="col-12 col-md-6">
8
+
9
+ <div class="field">
10
+ <%= label_tag :txid, "TXID" %>
11
+ <%= text_field_tag :txid, payment.source.txid, class:"fullwidth", disabled: true %>
12
+ </div>
13
+
14
+ <div class="field">
15
+ <%= label_tag :payer_name, "Nome" %>
16
+ <%= text_field_tag :payer_name, payment.source.payer_name, class:"fullwidth", disabled: true %>
17
+ </div>
18
+
19
+ <div class="field">
20
+ <%= label_tag :expiration, "Criação" %>
21
+ <%= text_field_tag :expiration, payment.source.created_at.in_time_zone('America/Sao_Paulo').strftime("%d/%m/%Y às %H:%M"), class:"fullwidth", disabled: true %>
22
+ </div>
23
+
24
+ <div class="field">
25
+ <%= label_tag :amount, "Valor" %>
26
+ <%= text_field_tag :amount, number_to_currency(payment.source.amount), class:"fullwidth", disabled: true %>
27
+ </div>
28
+ </div>
29
+
30
+ <div class="col-12 col-md-6">
31
+ <div class="field">
32
+ <%= label_tag :status, "Status" %>
33
+ <%= text_field_tag :status, payment.source.status, class:"fullwidth", disabled: true %>
34
+ </div>
35
+
36
+ <div class="field">
37
+ <%= label_tag :payer_tax_id, "Documento" %>
38
+ <%= text_field_tag :payer_tax_id, payment.source.payer_tax_id, class:"fullwidth", disabled: true %>
39
+ </div>
40
+
41
+ <div class="field">
42
+ <%= label_tag :expiration, "Expiração" %>
43
+ <%= text_field_tag :expiration, payment.source.expiration.in_time_zone('America/Sao_Paulo').strftime("%d/%m/%Y às %H:%M"), class:"fullwidth", disabled: true %>
44
+ </div>
45
+
46
+ <div class="field">
47
+ <%= label_tag :amount, "Total Pago" %>
48
+ <%= text_field_tag :amount, number_to_currency(payment.source.paid_amount || 0), class:"fullwidth", disabled: true %>
49
+ </div>
50
+ </div>
51
+
52
+ <div class="col-12">
53
+ <div class="field">
54
+ <%= label_tag :copia_cola, "Copia e Cola" %>
55
+ <%= text_field_tag :copia_cola, payment.source.pix_code, class:"fullwidth", disabled: true %>
56
+ </div>
57
+ <div class="field">
58
+ <div style="display: flex; justify-content: center; align-items: center;">
59
+ <%= payment.source.qr_code_svg.html_safe %>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </fieldset>
64
+ </div>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusInter
4
- VERSION = "1.1.1"
4
+ VERSION = "1.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_inter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ulysses
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-07 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
@@ -105,6 +105,7 @@ files:
105
105
  - README.md
106
106
  - Rakefile
107
107
  - app/models/solidus_inter/account.rb
108
+ - app/models/solidus_inter/gateway.rb
108
109
  - app/models/solidus_inter/inter_pix.rb
109
110
  - app/models/solidus_inter/pix_payment_source.rb
110
111
  - app/views/spree/admin/payments/source_forms/_inter_pix.html.erb
@@ -154,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
155
  - !ruby/object:Gem::Version
155
156
  version: '0'
156
157
  requirements: []
157
- rubygems_version: 3.5.10
158
+ rubygems_version: 3.5.11
158
159
  signing_key:
159
160
  specification_version: 4
160
161
  summary: ''