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: 280c47fbcd1f68b9b8388c7a668578c88c6256da12248c9c7094460db5a9bc46
4
- data.tar.gz: de3c7200fd94ef8d836ebde417fb005d5da3338b84ee4519d85c180199b5fbef
3
+ metadata.gz: adc06f64a7c86fb2853d12401bda4179708cd5eb65a7f73073c817fb14af08e8
4
+ data.tar.gz: 061fc971048552be99c8df628d3b29318179f8a915a50c6bdf26ebca4889b6a4
5
5
  SHA512:
6
- metadata.gz: 89bad0499c9b211cd2d0ca91f2a34709a75b128a98ec93e9fe6718a942fa26bd0483c78a4b1d3a5c8370089732a08d5a4fab32c40aad551a04c9cdf54a0da772
7
- data.tar.gz: a4e5a09162bf1d373aeae3c8f3e0b3319e57521e42f78910b2a0c41a589ade9372075921e3bca2f9e6973e6bc2f64ea1b2e8c49693a01f1d16b604390515d0c1
6
+ metadata.gz: ca30ba89cd28bc1746098958298faf8a2eda6bda1561af7d4b3708f1d24684de3f3d97336755cdeec18357f3897523f27329eb6cad8940acbad9fc7158865869
7
+ data.tar.gz: e070ac29be02557a7fb7b509dce0d5e8620ccc7611020bfcdaa012a3b096fbd45b5bac9f7ea36e1bca1b2b0c9cea968d17c9503e06cd165941f4983df914a780
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (2.16.1)
4
+ catarse_pagarme (2.16.2)
5
5
  countries (= 3.0.0)
6
6
  konduto-ruby (= 2.1.0)
7
7
  pagarme (= 2.1.4)
@@ -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
- def change_status_by_transaction(transaction_status)
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.gateway_fee = get_fee
34
+ PaymentEngines.import_payables(payment)
36
35
  payment.save!
37
36
  end
38
37
 
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "2.16.1"
2
+ VERSION = "2.16.2"
3
3
  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.16.1
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-06-10 00:00:00.000000000 Z
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