Fix references not being pulled

This commit is contained in:
Mark Veidemanis 2022-04-06 12:26:01 +01:00
parent 74bcf4a5ab
commit cd0a772e65
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 6 additions and 3 deletions

View File

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