Module: Vpago::PaymentAmountCalculator
- Included in:
- Acleda::Base, AcledaMobile::Base, WingSdk::Base
- Defined in:
- lib/vpago/payment_amount_calculator.rb
Instance Method Summary collapse
- #amount ⇒ Object
- #amount_with_fee ⇒ Object
- #transaction_fee ⇒ Object
- #transaction_fee_fix ⇒ Object
- #transaction_fee_percentage ⇒ Object
Instance Method Details
#amount ⇒ Object
3 4 5 |
# File 'lib/vpago/payment_amount_calculator.rb', line 3 def amount @payment.amount end |
#amount_with_fee ⇒ Object
7 8 9 |
# File 'lib/vpago/payment_amount_calculator.rb', line 7 def amount_with_fee format('%.2f', (amount + transaction_fee)) end |
#transaction_fee ⇒ Object
19 20 21 |
# File 'lib/vpago/payment_amount_calculator.rb', line 19 def transaction_fee transaction_fee_fix + ((amount * transaction_fee_percentage) / 100) end |
#transaction_fee_fix ⇒ Object
11 12 13 |
# File 'lib/vpago/payment_amount_calculator.rb', line 11 def transaction_fee_fix @payment.payment_method.preferences[:transaction_fee_fix].to_f end |
#transaction_fee_percentage ⇒ Object
15 16 17 |
# File 'lib/vpago/payment_amount_calculator.rb', line 15 def transaction_fee_percentage @payment.payment_method.preferences[:transaction_fee_percentage].to_f end |