diff --git a/app/integrations/simbrella.py b/app/integrations/simbrella.py index 920ea9f..3a3b650 100644 --- a/app/integrations/simbrella.py +++ b/app/integrations/simbrella.py @@ -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