From 7effd6095458c874aaa47f0d48f5507fc906e5e3 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 9 Mar 2022 07:10:25 +0000 Subject: [PATCH] Fix references and make releasing live --- handler/transactions.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/handler/transactions.py b/handler/transactions.py index e7365bd..264b4ca 100644 --- a/handler/transactions.py +++ b/handler/transactions.py @@ -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):