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']:
|
for status in ['PENDING', 'COMPLETED']:
|
||||||
transac = self.document['data']['activity'][status]
|
transac = self.document['data']['activity'][status]
|
||||||
for t in transac:
|
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)
|
transactions.sort(key=lambda tr: tr.rdate, reverse=True)
|
||||||
for t in transactions:
|
for t in transactions:
|
||||||
|
|
@ -105,7 +107,10 @@ class NewPartHistoryPage(Page):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raw = transaction['displayType']
|
raw = transaction['displayType']
|
||||||
t.parse(date=date, raw=raw)
|
t.parse(date=date, raw=raw)
|
||||||
|
try:
|
||||||
amount = transaction['displayAmount']
|
amount = transaction['displayAmount']
|
||||||
|
except KeyError:
|
||||||
|
return
|
||||||
t.set_amount(amount)
|
t.set_amount(amount)
|
||||||
t._currency = transaction['currencyCode']
|
t._currency = transaction['currencyCode']
|
||||||
return t
|
return t
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue