From 77033c3f09de84a5f2f021a681d1e7ec74e5fdfd Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 25 Jan 2022 13:01:39 +0000 Subject: [PATCH] Ignore card and negative transactions --- handler/transactions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/handler/transactions.py b/handler/transactions.py index c46598b..a34ae68 100644 --- a/handler/transactions.py +++ b/handler/transactions.py @@ -46,6 +46,9 @@ class Transactions(object): self.log.error("Type not in inside: {inside}", inside=inside) return txtype = inside["type"] + if txtype == "card_payment": + self.log.info("Ignoring card payment: {id}", id=txid) + return state = inside["state"] if "reference" in inside: reference = inside["reference"] @@ -60,6 +63,9 @@ class Transactions(object): account_type = "not_given" amount = leg["amount"] + if amount <= 0: + self.log.info("Ignoring transaction with negative/zero amount: {id}", id=txid) + return currency = leg["currency"] description = leg["description"]