catarse_pagarme 2.16.1 → 2.16.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adc06f64a7c86fb2853d12401bda4179708cd5eb65a7f73073c817fb14af08e8
|
4
|
+
data.tar.gz: 061fc971048552be99c8df628d3b29318179f8a915a50c6bdf26ebca4889b6a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca30ba89cd28bc1746098958298faf8a2eda6bda1561af7d4b3708f1d24684de3f3d97336755cdeec18357f3897523f27329eb6cad8940acbad9fc7158865869
|
7
|
+
data.tar.gz: e070ac29be02557a7fb7b509dce0d5e8620ccc7611020bfcdaa012a3b096fbd45b5bac9f7ea36e1bca1b2b0c9cea968d17c9503e06cd165941f4983df914a780
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
module CatarsePagarme
|
2
2
|
class PaymentDelegator
|
3
3
|
attr_accessor :payment, :transaction
|
4
|
-
include FeeCalculatorConcern
|
5
4
|
|
6
5
|
def initialize(payment)
|
7
6
|
configure_pagarme
|
8
7
|
self.payment = payment
|
9
8
|
end
|
10
9
|
|
11
|
-
|
10
|
+
def change_status_by_transaction(transaction_status)
|
12
11
|
case transaction_status
|
13
12
|
when 'pending_review' then
|
14
13
|
self.payment.try(:notify_about_pending_review)
|
@@ -32,7 +31,7 @@ module CatarsePagarme
|
|
32
31
|
def update_transaction
|
33
32
|
fill_acquirer_data
|
34
33
|
payment.installment_value = (value_for_installment / 100.0).to_f
|
35
|
-
payment
|
34
|
+
PaymentEngines.import_payables(payment)
|
36
35
|
payment.save!
|
37
36
|
end
|
38
37
|
|
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.16.
|
4
|
+
version: 2.16.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-
|
12
|
+
date: 2020-07-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: countries
|
@@ -194,7 +194,6 @@ files:
|
|
194
194
|
- app/models/catarse_pagarme/balance_transfer_delegator.rb
|
195
195
|
- app/models/catarse_pagarme/bank_account_concern.rb
|
196
196
|
- app/models/catarse_pagarme/credit_card_transaction.rb
|
197
|
-
- app/models/catarse_pagarme/fee_calculator_concern.rb
|
198
197
|
- app/models/catarse_pagarme/payment_concern.rb
|
199
198
|
- app/models/catarse_pagarme/payment_delegator.rb
|
200
199
|
- app/models/catarse_pagarme/payment_type.rb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module CatarsePagarme::FeeCalculatorConcern
|
2
|
-
extend ActiveSupport::Concern
|
3
|
-
|
4
|
-
included do
|
5
|
-
|
6
|
-
def get_fee
|
7
|
-
return nil if self.payment.payment_method.blank? # We always depend on the payment_choice
|
8
|
-
|
9
|
-
transaction = PagarMe::Transaction.find(self.payment.gateway_id)
|
10
|
-
payables = transaction.payables
|
11
|
-
cost = transaction.cost.to_f / 100.00
|
12
|
-
payables_fee = payables.to_a.sum(&:fee).to_f / 100.00
|
13
|
-
|
14
|
-
if self.payment.payment_method == ::CatarsePagarme::PaymentType::SLIP
|
15
|
-
payables_fee == 0 ? cost : payables_fee
|
16
|
-
else
|
17
|
-
cost + payables_fee
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|