Add the recipient to the account details

This commit is contained in:
Mark Veidemanis 2022-04-21 20:45:27 +01:00
parent 7f51c7cb4b
commit 7d9679f2d5
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
3 changed files with 17 additions and 0 deletions

View File

@ -197,6 +197,7 @@ class Markets(util.Base):
if account["currency"] == currency:
currency_account_info_map[currency] = account["account_number"]
currency_account_info_map[currency]["bank"] = bank.split("_")[0]
currency_account_info_map[currency]["recipient"] = account["recipient"]
return (supported_currencies, currency_account_info_map)
def get_matching_account_details(self, platform, currency):

View File

@ -247,11 +247,13 @@ class Nordigen(util.Base):
if "bban" in parsed and parsed["currency"] == "GBP":
sort_code = parsed["bban"][0:6]
account_number = parsed["bban"][6:]
recipient = parsed["ownerName"]
del parsed["bban"]
del parsed["iban"]
sort_code = "-".join(list(map("".join, zip(*[iter(sort_code)] * 2))))
parsed["sort_code"] = sort_code
parsed["number"] = account_number
parsed["recipient"] = recipient
# Let's add the account ID so we can reference it later
parsed["account_id"] = account_id
return parsed

View File

@ -939,3 +939,17 @@ class IRCCommands(object):
identifier = spl[1]
verified = ux.verify.get_external_user_id_status(identifier)
msg(f"Verification status: {verified}")
class bankdetails(object):
name = "bankdetails"
authed = True
helptext = "Get the bank details for a platform. Usage: bankdetails <platform> <currency>"
@staticmethod
def run(cmd, spl, length, authed, msg, agora, tx, ux):
if length == 3:
platform = spl[1]
currency = spl[2]
account_info = tx.markets.get_matching_account_details(platform, currency)
bank_details = tx.markets.format_payment_details(currency, account_info, real=True)
msg(bank_details)