From 680c9744371c799b56b5035e7a1ce5c37bebe01f Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 20 Apr 2022 20:47:20 +0100 Subject: [PATCH] Pass the real bank details after verification --- handler/transactions.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/handler/transactions.py b/handler/transactions.py index ffadf07..55e33f3 100644 --- a/handler/transactions.py +++ b/handler/transactions.py @@ -465,7 +465,6 @@ class Transactions(util.Base): self.log.info(f"User has completed verification: {uid}") trade_list = self.find_trades_by_uid(uid) for platform, trade_id, reference, currency in trade_list: - self.log.info(f"Sending bank details/reference for {platform}/{reference}") self.send_bank_details(platform, currency, trade_id) self.send_reference(platform, trade_id, reference) @@ -518,9 +517,10 @@ class Transactions(util.Base): Send the bank details to a trade. """ send_setting, post_message = self.get_send_settings(platform) + self.log.info(f"Sending bank details/reference for {platform}/{trade_id}") if send_setting == "1": account_info = self.markets.get_matching_account_details(platform, currency) - formatted_account_info = self.markets.format_payment_details(currency, account_info) + formatted_account_info = self.markets.format_payment_details(currency, account_info, real=True) print("formatted", formatted_account_info) post_message( trade_id, @@ -546,7 +546,6 @@ class Transactions(util.Base): reference = f"PGN-{reference}" existing_ref = r.get(f"trade.{trade_id}.reference") if not existing_ref: - r.set(f"trade.{trade_id}.reference", reference) to_store = { "id": trade_id, "tx": "", @@ -561,6 +560,7 @@ class Transactions(util.Base): } self.log.info(f"Storing trade information: {str(to_store)}") r.hmset(f"trade.{reference}", to_store) + r.set(f"trade.{trade_id}.reference", reference) self.irc.sendmsg(f"Generated reference for {trade_id}: {reference}") self.ux.notify.notify_new_trade(amount, currency) uid = self.create_uid(subclass, buyer) @@ -569,10 +569,8 @@ class Transactions(util.Base): if verified != "GREEN": self.log.info(f"UID {uid} is not verified, sending link.") self.send_verification_url(subclass, uid, trade_id) - return else: # User is verified self.log.info(f"UID {uid} is verified.") - self.log.info(f"Sending bank details/reference for {subclass}/{reference}") self.send_bank_details(subclass, currency, trade_id) self.send_reference(subclass, trade_id, reference) if existing_ref: