catarse_pagarme 2.4.2 → 2.4.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: b95d35996e19a543468ea0515d70d555f5e47d3c
4
- data.tar.gz: 39ad2fb520a832a509b9605795aba019215ee5ce
3
+ metadata.gz: eabfdb658f6065f491e2ee36f066d0b358177141
4
+ data.tar.gz: 0ae85bbec7fed49421ea5bf11448eb9d2c70292c
5
5
  SHA512:
6
- metadata.gz: dac0f105f5291fda4ae09442524a2d2bb61ab407629b57d0dc0e44e2c9a013bc91bbbdf7c1183a808a3c49f86e0c450c0667a6dbe6d2ec73947cc6061d76a97c
7
- data.tar.gz: 064697b9651aae7cd6c07dcf2d772deb5e79a9e52939608e7b63645c6da4d1f1929fbe8b4763f972b629bdbbbd57b147e92a7e03ab1fa38a88239edaa81ee795
6
+ metadata.gz: 7ef1d69d9a9358b8ea1282caa2b0685af11b00c2e5e4dbab6eb1812ef50c1be22dfefd64c7643f5ec42a311b2befc55016cb2a9063a25a0a868c1e290c1030f2
7
+ data.tar.gz: 8509502bf0c000891a9cc8866087a38f4028db586f6cb70e4b37e28420217022f27e192ef6a34671b951ccb7f34a419126116b2211b0107593455c3cd0661643
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (2.3.10)
4
+ catarse_pagarme (2.4.3)
5
5
  pagarme (~> 1.9.8)
6
6
  rails (~> 4.0)
7
7
 
@@ -52,8 +52,8 @@ GEM
52
52
  mime-types (1.25.1)
53
53
  minitest (5.4.0)
54
54
  multi_json (1.10.1)
55
- netrc (0.8.0)
56
- pagarme (1.9.8)
55
+ netrc (0.10.2)
56
+ pagarme (1.9.9)
57
57
  multi_json
58
58
  rest-client
59
59
  pg (0.17.1)
@@ -10,10 +10,10 @@ module CatarsePagarme::FeeCalculatorConcern
10
10
  if acquirer_name == 'stone'
11
11
  self.contribution.installments > 1 ? tax_calc_for_installment(stone_tax) : tax_calc(stone_tax)
12
12
  else
13
- if self.transaction.card_brand == 'amex'
13
+ if self.contribution.card_brand == 'amex'
14
14
  self.contribution.installments > 1 ? tax_calc_for_installment(cielo_installment_amex_tax) : tax_calc(cielo_installment_not_amex_tax)
15
15
  else
16
- current_tax = self.transaction.card_brand == 'diners' ? installment_diners_tax : installment_not_diners_tax
16
+ current_tax = self.contribution.card_brand == 'diners' ? installment_diners_tax : installment_not_diners_tax
17
17
  self.contribution.installments > 1 ? tax_calc_for_installment(current_tax) : tax_calc(cielo_tax)
18
18
  end
19
19
  end
@@ -29,7 +29,8 @@ module CatarsePagarme
29
29
  installments: (self.transaction.installments || 1),
30
30
  installment_value: (delegator.value_for_installment(self.transaction.installments || 0) / 100.0).to_f,
31
31
  acquirer_name: self.transaction.acquirer_name,
32
- acquirer_tid: self.transaction.tid
32
+ acquirer_tid: self.transaction.tid,
33
+ card_brand: self.transaction.try(:card_brand)
33
34
  }
34
35
  end
35
36
 
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "2.4.2"
2
+ VERSION = "2.4.3"
3
3
  end
@@ -4,15 +4,16 @@ describe CatarsePagarme::CreditCardTransaction do
4
4
  let(:contribution) { create(:contribution, value: 100) }
5
5
 
6
6
  let(:pagarme_transaction) {
7
- transaction = double
8
- transaction.stub(:id).and_return('abcd')
9
- transaction.stub(:charge).and_return(true)
10
- transaction.stub(:status).and_return('paid')
11
- transaction.stub(:boleto_url).and_return(nil)
12
- transaction.stub(:installments).and_return(3)
13
- transaction.stub(:acquirer_name).and_return('stone')
14
- transaction.stub(:tid).and_return('123123')
15
- transaction
7
+ double({
8
+ id: 'abcd',
9
+ charge: true,
10
+ status: 'paid',
11
+ boleto_url: nil,
12
+ installments: 3,
13
+ acquirer_name: 'stone',
14
+ tid: '123123',
15
+ card_brand: 'visa'
16
+ })
16
17
  }
17
18
 
18
19
  let(:valid_attributes) do
@@ -3,15 +3,16 @@ require 'spec_helper'
3
3
  describe CatarsePagarme::SlipTransaction do
4
4
  let(:contribution) { create(:contribution, value: 100) }
5
5
  let(:pagarme_transaction) {
6
- transaction = double
7
- transaction.stub(:id).and_return('abcd')
8
- transaction.stub(:charge).and_return(true)
9
- transaction.stub(:status).and_return('paid')
10
- transaction.stub(:boleto_url).and_return('boleto url')
11
- transaction.stub(:installments).and_return(1)
12
- transaction.stub(:acquirer_name).and_return('pagarme')
13
- transaction.stub(:tid).and_return('123123')
14
- transaction
6
+ double({
7
+ id: 'abcd',
8
+ charge: true,
9
+ status: 'paid',
10
+ boleto_url: 'boleto url',
11
+ installments: 1,
12
+ acquirer_name: 'pagarme',
13
+ tid: '123123',
14
+ card_brand: nil
15
+ })
15
16
  }
16
17
  let(:valid_attributes) do
17
18
  {
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.4.2
4
+ version: 2.4.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: 2015-01-29 00:00:00.000000000 Z
12
+ date: 2015-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails