Begin implementing per-requisition configuration
This commit is contained in:
@@ -19,6 +19,7 @@ class AggregatorClient(ABC):
|
||||
# #if account["account_id"] in self.banks
|
||||
# }
|
||||
# For each bank
|
||||
print("ACCOUNT INFOS", account_infos)
|
||||
for bank, accounts in account_infos.items():
|
||||
# Iterate the accounts
|
||||
for index, account in enumerate(list(accounts)):
|
||||
@@ -50,6 +51,8 @@ class AggregatorClient(ABC):
|
||||
self.instance.currencies = currencies
|
||||
self.instance.save()
|
||||
|
||||
print("INSTANCE ACCOUNT INFO", self.instance.account_info)
|
||||
|
||||
async def process_transactions(self, account_id, transactions):
|
||||
if not transactions:
|
||||
return False
|
||||
|
||||
@@ -1104,6 +1104,12 @@ class LocalPlatformClient(ABC):
|
||||
currency_account_info_map[currency]["recipient"] = account[
|
||||
"ownerName"
|
||||
]
|
||||
currency_account_info_map[currency]["aggregator_id"] = account[
|
||||
"aggregator_id"
|
||||
]
|
||||
currency_account_info_map[currency]["requisition_id"] = account[
|
||||
"requisition_id"
|
||||
]
|
||||
return (list(currency_account_info_map.keys()), currency_account_info_map)
|
||||
|
||||
def get_matching_account_details(self, currency, ad):
|
||||
@@ -1200,12 +1206,21 @@ class LocalPlatformClient(ABC):
|
||||
if not payment_details:
|
||||
return False
|
||||
if real:
|
||||
payment = ad.payment_details_real
|
||||
aggregator_id = payment_details["aggregator_id"]
|
||||
requisition_id = payment_details["requisition_id"]
|
||||
req = self.instance.get_requisition(aggregator_id, requisition_id)
|
||||
if req:
|
||||
payment = req.payment_details
|
||||
else:
|
||||
payment = ad.payment_details_real
|
||||
else:
|
||||
payment = ad.payment_details
|
||||
|
||||
payment_text = ""
|
||||
for field, value in payment_details.items():
|
||||
if field in ["aggregator_id", "requisition_id"]:
|
||||
# Don't send these to the user
|
||||
continue
|
||||
formatted_name = field.replace("_", " ")
|
||||
formatted_name = formatted_name.capitalize()
|
||||
payment_text += f"* {formatted_name}: **{value}**"
|
||||
|
||||
Reference in New Issue
Block a user