Class: PaypalTransaction::MasspaySubpayment
- Inherits:
-
PaypalTransaction
- Object
- ActiveRecord::Base
- PaypalTransaction
- PaypalTransaction::MasspaySubpayment
- Defined in:
- lib/bookkeeper/paypal_transaction/masspay_subpayment.rb
Instance Method Summary collapse
Instance Method Details
#payer_account ⇒ Object
14 15 16 |
# File 'lib/bookkeeper/paypal_transaction/masspay_subpayment.rb', line 14 def payer_account @payer_account ||= Account::Asset.find_by_account_number(self.notification.params['payer_email']) end |
#to_postings ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/bookkeeper/paypal_transaction/masspay_subpayment.rb', line 3 def to_postings gross = self.notification.amount.cents.to_f / 100 fee = self.notification.fee.to_f postings = [] postings << payer_account.credit(gross + fee) postings << Account.paypal_fees_account.debit(fee) if(fee > 0) postings end |