Fix references and make releasing live

This commit is contained in:
Mark Veidemanis 2022-03-09 07:10:25 +00:00
parent 4a0d8ed1ad
commit 7effd60954
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 8 additions and 3 deletions

View File

@ -84,7 +84,13 @@ class Transactions(util.Base):
return
currency = data["currency"]
description = data["description"]
reference = data["meta"]["provider_reference"]
if "meta" in data:
if "provider_reference" in data["meta"]:
reference = data["meta"]["provider_reference"]
else:
reference = "not_set"
else:
reference = "not_set"
to_store = {
"trade_id": "",
@ -172,8 +178,7 @@ class Transactions(util.Base):
return
r.hmset(f"tx.{txid}", to_store)
# self.release_funds(stored_trade["id"], stored_trade["reference"])
print("WOULD RELEASE THE FUCKING MONEY")
self.release_funds(stored_trade["id"], stored_trade["reference"])
self.ux.notify.notify_complete_trade(amount, currency)
def release_funds(self, trade_id, reference):