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": "",