solidus_mp 0.3.4 → 0.3.6

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: d5ba5e31166fc4e806d4668796cc9e7ef3adfbbe7083a780512e73ad43600790
4
- data.tar.gz: bd2744631da9aa66e8cdf2adf2b026c84ccfcb7d621725e7113c65eee625399d
3
+ metadata.gz: 72e067802a3b96e6830c7b63fac81cdd014e0c8febd255d7e4d8006a0c84a46d
4
+ data.tar.gz: 7898b7afccd566b511bff013c0765d7dada4f7fa9117cdd67ed9e0774e240626
5
5
  SHA512:
6
- metadata.gz: aaa56ecbb91b39abc1aca44b3d63c96997a199e3819fef78644d4a8aa98482e2d0f0ffc0c94abc2f51085af68d1736f61997b946f10c5f2797cdae143528c8ae
7
- data.tar.gz: 0756e7ac7922ebcbed3e6baf2c4347e4674c0f59cf2895ad04038bc4226a91b9d615558a95c3527a9993d6aab3991bccd601c12ba9cff11e80ad1666760ebc18
6
+ metadata.gz: 3324347d77daa6788a3a74653838358d015ab86de8d507b04639dcf3fc2bb5144ef747e15dfb18f9db7291fbfd664ed31536a0a12f4822cdcc51f2c446f8bcef
7
+ data.tar.gz: 59818424ddc907b7a44518766708bfe51f6f8307287c157fecd09ff533e166f6637ea9f53548aec62385e9cb74ab0864eaf2a4e8b3bf4bf1ceff07452100c955
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
- require 'solidus_dev_support/rake_tasks'
5
- SolidusDevSupport::RakeTasks.install
4
+ # require 'solidus_dev_support/rake_tasks'
5
+ # SolidusDevSupport::RakeTasks.install
6
6
 
7
7
  task default: 'extension:specs'
@@ -22,7 +22,7 @@ module SolidusMp
22
22
  payment.source.update(external_id: mp_payment.id, three_ds_url: mp_payment.three_ds_info_external_resource_url, three_ds_creq: mp_payment.three_ds_info_creq)
23
23
  if mp_payment.error || mp_payment.internal_error
24
24
  payment.invalidate
25
- error_message = mp_payment.error || mp_payment.internal_error
25
+ error_message = "#{mp_payment.error || mp_payment.internal_error} (#{mp_payment.status_detail})"
26
26
  response = failure_response(error_message)
27
27
  payment.log_entries.create!(parsed_payment_response_details_with_fallback: response)
28
28
  payment.source.update(error_message: mp_payment.error || "Ocorreu um erro ao criar o pagamento.", status: "error")
@@ -17,6 +17,10 @@ module SolidusMp
17
17
  source.is_a?(payment_source_class)
18
18
  end
19
19
 
20
+ def auto_capture?
21
+ true
22
+ end
23
+
20
24
  def create_pix_payment payment
21
25
  mp_payment = create_mp_payment(payment)
22
26
  if mp_payment.error || mp_payment.internal_error
@@ -56,6 +60,16 @@ module SolidusMp
56
60
  end
57
61
  end
58
62
 
63
+ def should_skip_processing?(source)
64
+ MpApi.configuration.access_token = preferences[:access_token]
65
+ mp_payment = MpApi::Payment.find_by_id(source.external_id)
66
+ if mp_payment.status == "approved"
67
+ false
68
+ else
69
+ true
70
+ end
71
+ end
72
+
59
73
  def partial_name
60
74
  'mercado_pago_pix'
61
75
  end
@@ -77,4 +91,4 @@ module SolidusMp
77
91
  end
78
92
 
79
93
  end
80
- end
94
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusMp
4
- VERSION = '0.3.4'
4
+ VERSION = '0.3.6'
5
5
  end
data/solidus_mp.gemspec CHANGED
@@ -10,12 +10,12 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  spec.summary = ''
12
12
  spec.description = ''
13
- spec.homepage = 'https://github.com/CaioGarcia1/'
13
+ spec.homepage = 'https://github.com/CaioGarcia1/solidus_mp'
14
14
  spec.license = 'BSD-3-Clause'
15
15
 
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
- spec.metadata['source_code_uri'] = 'https://github.com/CaioGarcia1/'
18
- spec.metadata['changelog_uri'] = 'https://github.com/CaioGarcia1/'
17
+ spec.metadata['source_code_uri'] = 'https://github.com/CaioGarcia1/solidus_mp'
18
+ spec.metadata['changelog_uri'] = 'https://github.com/CaioGarcia1/solidus_mp'
19
19
 
20
20
  spec.required_ruby_version = Gem::Requirement.new('>= 2.5', '< 4')
21
21
 
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: 0.3.4
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - caio
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-11 00:00:00.000000000 Z
11
+ date: 2024-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core
@@ -132,13 +132,13 @@ files:
132
132
  - spec/models/solidus_mp/card_payment_source_spec.rb
133
133
  - spec/models/solidus_mp/pix_payment_source_spec.rb
134
134
  - spec/spec_helper.rb
135
- homepage: https://github.com/CaioGarcia1/
135
+ homepage: https://github.com/CaioGarcia1/solidus_mp
136
136
  licenses:
137
137
  - BSD-3-Clause
138
138
  metadata:
139
- homepage_uri: https://github.com/CaioGarcia1/
140
- source_code_uri: https://github.com/CaioGarcia1/
141
- changelog_uri: https://github.com/CaioGarcia1/
139
+ homepage_uri: https://github.com/CaioGarcia1/solidus_mp
140
+ source_code_uri: https://github.com/CaioGarcia1/solidus_mp
141
+ changelog_uri: https://github.com/CaioGarcia1/solidus_mp
142
142
  post_install_message:
143
143
  rdoc_options: []
144
144
  require_paths:
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
159
  requirements: []
160
- rubygems_version: 3.4.19
160
+ rubygems_version: 3.4.6
161
161
  signing_key:
162
162
  specification_version: 4
163
163
  summary: ''