catarse_pagarme 2.4.2 → 2.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/app/models/catarse_pagarme/fee_calculator_concern.rb +2 -2
- data/app/models/catarse_pagarme/transaction_base.rb +2 -1
- data/lib/catarse_pagarme/version.rb +1 -1
- data/spec/models/catarse_pagarme/credit_card_transaction_spec.rb +10 -9
- data/spec/models/catarse_pagarme/slip_transaction_spec.rb +10 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eabfdb658f6065f491e2ee36f066d0b358177141
|
4
|
+
data.tar.gz: 0ae85bbec7fed49421ea5bf11448eb9d2c70292c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
56
|
-
pagarme (1.9.
|
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.
|
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.
|
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
|
|
@@ -4,15 +4,16 @@ describe CatarsePagarme::CreditCardTransaction do
|
|
4
4
|
let(:contribution) { create(:contribution, value: 100) }
|
5
5
|
|
6
6
|
let(:pagarme_transaction) {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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.
|
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-
|
12
|
+
date: 2015-02-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|