diff --git a/modules/n26/browser.py b/modules/n26/browser.py index 3d91db7d6a8af49a2869fed948277ff2966bdbdc..41af807dc96c45ef318efda8bc886ad20591683f 100644 --- a/modules/n26/browser.py +++ b/modules/n26/browser.py @@ -139,6 +139,13 @@ def get_coming(self, categories): @need_login def _internal_get_transactions(self, categories, filter_func): + TYPES = { + 'PT': Transaction.TYPE_CARD, + 'AA': Transaction.TYPE_CARD, + 'CT': Transaction.TYPE_TRANSFER, + 'WEE': Transaction.TYPE_BANK, + } + transactions = self.request('/api/smrt/transactions?limit=1000') for t in transactions: @@ -167,12 +174,7 @@ def _internal_get_transactions(self, categories, filter_func): if "originalAmount" in t: new.original_amount = Decimal(str(t["originalAmount"])) - if t["type"] == 'PT': - new.type = Transaction.TYPE_CARD - elif t["type"] == 'CT': - new.type = Transaction.TYPE_TRANSFER - elif t["type"] == 'WEE': - new.type = Transaction.TYPE_BANK + new.type = TYPES.get(t["type"], Transaction.TYPE_UNKNOWN) if t["category"] in categories: new.category = categories[t["category"]]