Started cleaning disbursement data

This commit was merged in pull request #17.
This commit is contained in:
2025-04-26 19:47:22 -04:00
parent a6054e5a26
commit 8760b9ba93
+12 -3
View File
@@ -46,8 +46,10 @@ class SimbrellaClient:
logger.info(f"Here are your loan_charges: {loan_charges}") logger.info(f"Here are your loan_charges: {loan_charges}")
mgt_fee = loan_charges.get("MGTFEE")['amount'] mgt_fee = loan_charges.get("MGTFEE")['amount']
vat_fee = loan_charges.get("VAT")['amount'] vat_fee = loan_charges.get("VAT")['amount']
interest_fee = loan_charges.get("INTEREST")['amount']
insurance_fee = loan_charges.get("INSURANCE")['amount']
disbursement_data ={ disbursement_data ={
"requestId": data['requestId'], "requestId": data['requestId'],
@@ -57,9 +59,9 @@ class SimbrellaClient:
"accountId": data['accountId'], "accountId": data['accountId'],
"productId": loan_data['productId'], "productId": loan_data['productId'],
"provideAmount": loan_data['currentLoanAmount'], "provideAmount": loan_data['currentLoanAmount'],
"collectAmountInterest": 5000, "collectAmountInterest": interest_fee,
"collectAmountMgtFee": mgt_fee, "collectAmountMgtFee": mgt_fee,
"collectAmountInsurance": 1000, "collectAmountInsurance": insurance_fee,
"collectAmountVAT": vat_fee, "collectAmountVAT": vat_fee,
"countryId": "01", "countryId": "01",
"comment": "Loan Disbursement", "comment": "Loan Disbursement",
@@ -70,6 +72,13 @@ class SimbrellaClient:
response = requests.post(api_url, json=disbursement_data, timeout=10, headers=get_headers()) response = requests.post(api_url, json=disbursement_data, timeout=10, headers=get_headers())
logger.info(f"Disbursement response: {response.json()}") logger.info(f"Disbursement response: {response.json()}")
except Exception as e: except Exception as e:
logger.info(f"Failed to call Disbursement endpoint: {e}") logger.info(f"Failed to call Disbursement endpoint: {e}")
return 0 return 0