Class: Dune::Balanced::Bankaccount::TransactionInclusiveFeeCalculator

Inherits:
TransactionFeeCalculatorBase show all
Defined in:
app/models/dune/balanced/bankaccount/transaction_inclusive_fee_calculator.rb

Instance Attribute Summary

Attributes inherited from TransactionFeeCalculatorBase

#transaction_value

Instance Method Summary collapse

Methods inherited from TransactionFeeCalculatorBase

#fees, #gross_amount, #initialize

Constructor Details

This class inherits a constructor from Dune::Balanced::Bankaccount::TransactionFeeCalculatorBase

Instance Method Details

#net_amountObject

Base calculation of fees 1% + 30¢ ($5 cap)



9
10
11
12
13
14
# File 'app/models/dune/balanced/bankaccount/transaction_inclusive_fee_calculator.rb', line 9

def net_amount
  [
    ((transaction_value - 0.3) / 1.01).floor_with_two_decimal_places,
    transaction_value - 5
  ].max
end