Added parameters clan up #17

Merged
ameye merged 1 commits from EVN-Dsibursement-data-clean-up- into master 2025-04-26 23:49:00 +00:00
+12 -3
View File
@@ -46,8 +46,10 @@ class SimbrellaClient:
logger.info(f"Here are your loan_charges: {loan_charges}")
mgt_fee = loan_charges.get("MGTFEE")['amount']
vat_fee = loan_charges.get("VAT")['amount']
interest_fee = loan_charges.get("INTEREST")['amount']
insurance_fee = loan_charges.get("INSURANCE")['amount']
disbursement_data ={
"requestId": data['requestId'],
@@ -57,9 +59,9 @@ class SimbrellaClient:
"accountId": data['accountId'],
"productId": loan_data['productId'],
"provideAmount": loan_data['currentLoanAmount'],
"collectAmountInterest": 5000,
"collectAmountInterest": interest_fee,
"collectAmountMgtFee": mgt_fee,
"collectAmountInsurance": 1000,
"collectAmountInsurance": insurance_fee,
"collectAmountVAT": vat_fee,
"countryId": "01",
"comment": "Loan Disbursement",
@@ -70,6 +72,13 @@ class SimbrellaClient:
response = requests.post(api_url, json=disbursement_data, timeout=10, headers=get_headers())
logger.info(f"Disbursement response: {response.json()}")
except Exception as e:
logger.info(f"Failed to call Disbursement endpoint: {e}")
return 0