catarse_pagarme 2.14.2 → 2.14.3

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
  SHA1:
3
- metadata.gz: 53d7da14773e31bafc649c63b69a07de310dc842
4
- data.tar.gz: 52984f3ffdc3550323314c35951eadf950568bb1
3
+ metadata.gz: 520199477c1059f4e458f4881b6cd4d0a8f2d168
4
+ data.tar.gz: 49fe125c2389cee318180307d16c65fc44aa21e8
5
5
  SHA512:
6
- metadata.gz: 1a3909bb2232c566560c9fef2d6838ac02fc8598707b98bc5b6c55ae21417f725f99b2fbd817db0fcf387d7f62cc546a081573d723771d0e4efbd70cad5c2d52
7
- data.tar.gz: 5d3024b3a4f507a81eb9b7e83e9c0235dc969bfff0320597c2cda049fbcbd454728837cc97ed6457fa6845498345c5e079ef1e5fdeb271871c7e6e0d905dd6a1
6
+ metadata.gz: af8960a447fb8f14d4949c045f5dfa71218d400fabf608ef560fb0eea3c728222a792f9c187919088619e6a5e559c8657428bbe1a83b422c9afead42e1df6966
7
+ data.tar.gz: 533b29a47b7a6ee81f369c27c0d0251fba4897f092e920efd231a44b130d65312555ebd231eafb24d2e067ec2886dca66a639c64b93f2e7364cc6062dc992bda
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (2.14.2)
4
+ catarse_pagarme (2.14.3)
5
5
  countries (= 3.0.0)
6
6
  konduto-ruby (= 2.1.0)
7
7
  pagarme (= 2.1.4)
@@ -40,6 +40,7 @@ module CatarsePagarme
40
40
  soft_descriptor: payment.project.permalink.gsub(/[\W\_]/, ' ')[0, MAX_SOFT_DESCRIPTOR_LENGTH],
41
41
  installments: get_installment,
42
42
  customer: {
43
+ id: contribution.user.id,
43
44
  email: contribution.user.email,
44
45
  name: contribution.user.name,
45
46
  document_number: document_number,
@@ -72,7 +72,8 @@ module CatarsePagarme
72
72
  def customer_attributes
73
73
  customer = self.attributes.dig(:customer)
74
74
  {
75
- id: customer[:document_number],
75
+ id: customer[:id].to_s,
76
+ tax_id: customer[:document_number],
76
77
  name: customer[:name],
77
78
  email: customer[:email],
78
79
  phone1: customer[:phone].to_h.values.join,
@@ -59,7 +59,7 @@ module CatarsePagarme
59
59
  begin
60
60
  antifraud_wrapper.send(analyze: true)
61
61
  rescue RuntimeError => e
62
- ::Raven.capture_exception(e)
62
+ ::Raven.capture_exception(e, level: 'fatal')
63
63
  OpenStruct.new(recommendation: :DECLINE)
64
64
  end
65
65
  end
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "2.14.2"
2
+ VERSION = "2.14.3"
3
3
  end
@@ -151,6 +151,7 @@ describe CatarsePagarme::AntifraudOrderWrapper do
151
151
  let(:attributes) do
152
152
  {
153
153
  customer: {
154
+ id: 123,
154
155
  document_number: '1234',
155
156
  name: 'John Appleseed',
156
157
  email: 'john@example.com',
@@ -169,7 +170,8 @@ describe CatarsePagarme::AntifraudOrderWrapper do
169
170
  it 'builds customer attributes' do
170
171
  customer_attributes = subject.__send__(:customer_attributes)
171
172
 
172
- expect(customer_attributes[:id]).to eq '1234'
173
+ expect(customer_attributes[:id]).to eq '123'
174
+ expect(customer_attributes[:tax_id]).to eq '1234'
173
175
  expect(customer_attributes[:name]).to eq 'John Appleseed'
174
176
  expect(customer_attributes[:email]).to eq 'john@example.com'
175
177
  expect(customer_attributes[:phone1]).to eq '858585858585'
@@ -252,7 +252,7 @@ describe CatarsePagarme::CreditCardTransaction do
252
252
  before { allow(card_transaction.antifraud_wrapper).to receive(:send).and_raise(exception) }
253
253
 
254
254
  it 'captures exception with Raven' do
255
- expect(Raven).to receive(:capture_exception).with(exception)
255
+ expect(Raven).to receive(:capture_exception).with(exception, { level: 'fatal' })
256
256
 
257
257
  card_transaction.process_antifraud
258
258
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catarse_pagarme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.2
4
+ version: 2.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antônio Roberto Silva
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-02-04 00:00:00.000000000 Z
12
+ date: 2020-03-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: countries