solidus_mp_dois 0.0.6 → 0.0.8

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: fbe553ad26fdf70bba78299a9909d85df562987334ac31f639d7b74f21cb5c57
4
- data.tar.gz: d94b30fef2774f825603f1207de8d70767068b4c402d45326902db3df3b67203
3
+ metadata.gz: 80632d9a2c759f03cf46cb691b62c9f6380a8f3de086afc0bac0065dae6798bc
4
+ data.tar.gz: f2ca611c4acd8111af809827072018f57e04c3e2bbebf5fc9f580e05450ccf70
5
5
  SHA512:
6
- metadata.gz: c29c5a9a1bf91fa8077511ab87a15a9433208f2ac9dd86f9ab864fe987364519292d772a8e2f60a5a766a026eefa3e417fac785259fe085778963f32dd934431
7
- data.tar.gz: 42c31a7f078f3f725435da1da57b6115961c8e5491332e4e52ded506357dbaebb33b6cd539e0cc6b1b3598c0aea156887da0c292c9d895cd20a0c3747b0b1a85
6
+ metadata.gz: 0f1ee67012256432f4dcb026afb340bddb9fce91374c63d28a08b4d701f0f473d1d9d0b8b176a73b66c08ec98f42969628c9603387c0311e913f4b543e16b198
7
+ data.tar.gz: '094ec31b037a3e266374449e930dc17e98201d043753baa0b485ad219baaa4ab253f5eefbd73f613b521b5087d0b3aa85ae54846df768d06b1cd7c9a9aedd4ee'
@@ -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)
@@ -0,0 +1,25 @@
1
+ class CreateSolidusMpDoisCreditCardSources < ActiveRecord::Migration[7.1]
2
+ def change
3
+ create_table :solidus_mp_dois_credit_card_sources do |t|
4
+ t.string :external_id
5
+ t.string :status
6
+ t.decimal :amount
7
+ t.string :payer_identification_type
8
+ t.string :tax_id
9
+ t.string :email
10
+ t.string :issuer_id
11
+ t.integer :installments
12
+ t.string :token
13
+ t.string :three_ds_mode
14
+ t.string :three_ds_creq
15
+ t.string :three_ds_url
16
+ t.string :card_brand
17
+ t.integer :payment_method_id
18
+ t.string :internal_error
19
+ t.string :last_four_digits
20
+ t.boolean :saved_card
21
+
22
+ t.timestamps
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,17 @@
1
+ class CreateSolidusMpDoisCustomers < ActiveRecord::Migration[7.1]
2
+ def change
3
+ create_table :solidus_mp_dois_customers do |t|
4
+ t.string :external_id
5
+ t.string :email
6
+ t.string :first_name
7
+ t.string :identification_type
8
+ t.string :tax_id
9
+ t.integer :spree_user_id, null: false
10
+
11
+ t.timestamps
12
+ t.foreign_key :spree_users, column: :spree_user_id
13
+ end
14
+
15
+ add_index :solidus_mp_dois_customers, :external_id, unique: true
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ class CreateSolidusMpDoisCards < ActiveRecord::Migration[7.1]
2
+ def change
3
+ create_table :solidus_mp_dois_cards do |t|
4
+ t.string :external_id
5
+ t.string :last_four_digits
6
+ t.string :mp_payment_method_id
7
+ t.integer :customer_id, null: false
8
+
9
+ t.timestamps
10
+ end
11
+
12
+ add_index :solidus_mp_dois_cards, :external_id, unique: true
13
+ end
14
+ end
@@ -0,0 +1,20 @@
1
+ class CreateSolidusMpDoisPixSources < ActiveRecord::Migration[7.1]
2
+ def change
3
+ create_table :solidus_mp_dois_pix_sources do |t|
4
+ t.string :external_id
5
+ t.string :status
6
+ t.decimal :amount
7
+ t.datetime :expiration
8
+ t.string :email
9
+ t.string :tax_id
10
+ t.integer :payment_method_id
11
+ t.string :qr_code
12
+ t.text :qr_code_base64
13
+ t.string :ticket_url
14
+ t.string :description
15
+ t.string :internal_error
16
+
17
+ t.timestamps
18
+ end
19
+ end
20
+ 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: 0.0.6
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todas Essas Coisas
@@ -58,6 +58,10 @@ files:
58
58
  - app/views/spree/admin/payments/source_views/_mercado_pago_pix.html.erb
59
59
  - app/views/spree/api/payments/source_views/_mercado_pago_card.json.jbuilder
60
60
  - app/views/spree/api/payments/source_views/_mercado_pago_pix.json.jbuilder
61
+ - db/migrate/20241119165521_create_solidus_mp_dois_credit_card_sources.rb
62
+ - db/migrate/20241125135226_create_solidus_mp_dois_customers.rb
63
+ - db/migrate/20241125201926_create_solidus_mp_dois_cards.rb
64
+ - db/migrate/20241209174725_create_solidus_mp_dois_pix_sources.rb
61
65
  - lib/generators/solidus_mp_dois/install/install_generator.rb
62
66
  - lib/generators/solidus_mp_dois/install/templates/app/javascript/controllers/card_payment_brick_controller.js
63
67
  - lib/generators/solidus_mp_dois/install/templates/app/javascript/controllers/payment_brick_controller.js