catarse_pagarme 2.14.1 → 2.14.2

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
  SHA1:
3
- metadata.gz: 23306e4f84f1866a86b3b2afa9e36d885447a6d3
4
- data.tar.gz: eba54e8909cecd5fe595913fba13d7a215c64571
3
+ metadata.gz: 53d7da14773e31bafc649c63b69a07de310dc842
4
+ data.tar.gz: 52984f3ffdc3550323314c35951eadf950568bb1
5
5
  SHA512:
6
- metadata.gz: 0ef4e604ce32df193d75eee9bc20e4e5b488ecd0a57ff265cfb883fd5d9e039b6b9062c7095fbcc86cf1a3c1226a245b5cd5789a2a42d92541b1643fd5248851
7
- data.tar.gz: 9f1a29b1590b0432bbf9985cc311c40d6685ebe549f3516bcaf13c13b46adf3fa28e0fd342ff8c6556b6958611d83e379dbc7805d7845b6548b63e386751d3dc
6
+ metadata.gz: 1a3909bb2232c566560c9fef2d6838ac02fc8598707b98bc5b6c55ae21417f725f99b2fbd817db0fcf387d7f62cc546a081573d723771d0e4efbd70cad5c2d52
7
+ data.tar.gz: 5d3024b3a4f507a81eb9b7e83e9c0235dc969bfff0320597c2cda049fbcbd454728837cc97ed6457fa6845498345c5e079ef1e5fdeb271871c7e6e0d905dd6a1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (2.14.1)
4
+ catarse_pagarme (2.14.2)
5
5
  countries (= 3.0.0)
6
6
  konduto-ruby (= 2.1.0)
7
7
  pagarme (= 2.1.4)
@@ -78,11 +78,11 @@ module CatarsePagarme
78
78
  end
79
79
 
80
80
  def document_number
81
- card_owner_document = contribution.card_owner_document.try(:gsub, /[-.\/_\s]/, '')
82
81
  user_document = contribution.user.cpf.try(:gsub, /[-.\/_\s]/, '')
82
+ card_owner_document = contribution.card_owner_document.try(:gsub, /[-.\/_\s]/, '')
83
83
  fallback_document = '00000000000'
84
84
 
85
- card_owner_document || user_document || fallback_document
85
+ user_document || card_owner_document || fallback_document
86
86
  end
87
87
 
88
88
  def phone_matches
@@ -93,7 +93,7 @@ module CatarsePagarme
93
93
  def billing_address_attributes
94
94
  billing_data = self.attributes.dig(:antifraud_metadata, :billing)
95
95
  {
96
- name: self.attributes.dig(:customer, :name),
96
+ name: self.transaction.card.holder_name,
97
97
  address1: billing_data.dig(:address, :street),
98
98
  city: billing_data.dig(:address, :city),
99
99
  state: billing_data.dig(:address, :state),
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "2.14.1"
2
+ VERSION = "2.14.2"
3
3
  end
@@ -250,7 +250,7 @@ describe CatarsePagarme::AntifraudOrderWrapper do
250
250
  }
251
251
  end
252
252
 
253
- let(:transaction) { double(card: double(country: 'BRAZIL')) }
253
+ let(:transaction) { double(card: double(country: 'BRAZIL', holder_name: 'holder name')) }
254
254
 
255
255
  before do
256
256
  subject.attributes = attributes
@@ -260,7 +260,7 @@ describe CatarsePagarme::AntifraudOrderWrapper do
260
260
  it 'builds customer attributes' do
261
261
  billing_address_attributes = subject.__send__(:billing_address_attributes)
262
262
 
263
- expect(billing_address_attributes[:name]).to eq 'John Appleseed'
263
+ expect(billing_address_attributes[:name]).to eq 'holder name'
264
264
  expect(billing_address_attributes[:address1]).to eq 'R. A'
265
265
  expect(billing_address_attributes[:city]).to eq 'New City'
266
266
  expect(billing_address_attributes[:state]).to eq 'NC'
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.1
4
+ version: 2.14.2
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-01-27 00:00:00.000000000 Z
12
+ date: 2020-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: countries