From cd0a772e655ed1586119456bf26101f425c68974 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 6 Apr 2022 12:26:01 +0100 Subject: [PATCH] Fix references not being pulled --- handler/transactions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/handler/transactions.py b/handler/transactions.py index 390a08e..5ee57b4 100644 --- a/handler/transactions.py +++ b/handler/transactions.py @@ -75,6 +75,7 @@ class Transactions(util.Base): :param data: details of transaction :type data: dict """ + print(f"Raw transaction data: {data}") ts = data["timestamp"] txid = data["transaction_id"] if "amount" not in data: @@ -86,15 +87,17 @@ class Transactions(util.Base): self.log.info(f"Ignoring transaction with negative/zero amount: {txid}") return currency = data["currency"] - if "meta" in data: + + if "reference" in data: + reference = data["reference"] + elif "meta" in data: if "provider_reference" in data["meta"]: reference = data["meta"]["provider_reference"] else: reference = "not_set" - elif "reference" in data: - reference = data["reference"] else: reference = "not_set" + subclass = data["subclass"] to_store = { "trade_id": "",