Class: PaypalTransaction::MasspaySubpayment

Inherits:
PaypalTransaction show all
Defined in:
lib/bookkeeper/paypal_transaction/masspay_subpayment.rb

Instance Method Summary collapse

Instance Method Details

#payer_accountObject



14
15
16
# File 'lib/bookkeeper/paypal_transaction/masspay_subpayment.rb', line 14

def 
  @payer_account ||= Account::Asset.(self.notification.params['payer_email'])
end

#to_postingsObject



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 << .credit(gross + fee)
  postings << Account..debit(fee) if(fee > 0)
  
  postings
end