Skip to content

Commit e8a9f54

Browse files
dpagemhagander
authored andcommitted
Support CARD_CASHBACK transactions in Wise
They behave the same as BALANCE_CASHBACK, but are labeled differently.
1 parent 92960aa commit e8a9f54

File tree

1 file changed

+4
-4
lines changed
  • postgresqleu/transferwise

1 file changed

+4
-4
lines changed

postgresqleu/transferwise/api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def get_transactions(self, startdate=None, enddate=None):
193193
'paymentref': reference,
194194
'fulldescription': fulldescription,
195195
}
196-
elif activity['type'] == 'BALANCE_CASHBACK':
196+
elif activity['type'] in ('BALANCE_CASHBACK', 'CARD_CASHBACK'):
197197
# No API endpoint to get this so we have to parse it out of
198198
# a ridiculously formatted field.
199199

@@ -203,13 +203,13 @@ def get_transactions(self, startdate=None, enddate=None):
203203
continue
204204

205205
yield {
206-
'id': 'BALANCE_CASHBACK-{}'.format(activity['resource']['id']),
206+
'id': '{}-{}'.format(activity['type'], activity['resource']['id']),
207207
'datetime': activity['updatedOn'],
208208
'amount': parsed_amount,
209209
'feeamount': 0,
210-
'transtype': 'BALANCE_CASHBACK',
210+
'transtype': activity['type'],
211211
'paymentref': '',
212-
'fulldescription': 'Balance Cashback',
212+
'fulldescription': activity['type'].title().replace('_', ' '),
213213
}
214214
elif activity['type'] == 'CARD_PAYMENT':
215215
# For card payments, normal tokens appear not to have permissions

0 commit comments

Comments
 (0)