paypal : we now ignore transactions with no 'displayAmount'
This commit is contained in:
parent
c80924f571
commit
3301f578a2
1 changed files with 7 additions and 2 deletions
|
|
@ -91,7 +91,9 @@ class NewPartHistoryPage(Page):
|
|||
for status in ['PENDING', 'COMPLETED']:
|
||||
transac = self.document['data']['activity'][status]
|
||||
for t in transac:
|
||||
transactions.append(self.parse_transaction(t))
|
||||
tran = self.parse_transaction(t)
|
||||
if tran:
|
||||
transactions.append(tran)
|
||||
|
||||
transactions.sort(key=lambda tr: tr.rdate, reverse=True)
|
||||
for t in transactions:
|
||||
|
|
@ -105,7 +107,10 @@ class NewPartHistoryPage(Page):
|
|||
except KeyError:
|
||||
raw = transaction['displayType']
|
||||
t.parse(date=date, raw=raw)
|
||||
try:
|
||||
amount = transaction['displayAmount']
|
||||
except KeyError:
|
||||
return
|
||||
t.set_amount(amount)
|
||||
t._currency = transaction['currencyCode']
|
||||
return t
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue