Class: PaypalTransaction::Single

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

Instance Method Summary collapse

Instance Method Details

#to_postingsObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/bookkeeper/paypal_transaction/single.rb', line 3

def to_postings
  gross = self.notification.amount.cents.to_f / 100
  fee = self.notification.fee.to_f
  
  postings = []
  postings << .debit(gross - fee)
  postings << Account..debit(fee) if(fee > 0)
  
  postings
end