More checks
This commit is contained in:
+30
-22
@@ -66,31 +66,39 @@ def disbursement():
|
|||||||
|
|
||||||
@autocall_bp.route("/retry-disbursement", methods=["POST"])
|
@autocall_bp.route("/retry-disbursement", methods=["POST"])
|
||||||
def retry_disbursement():
|
def retry_disbursement():
|
||||||
data = request.get_json()
|
try:
|
||||||
logger.info(f"Retry Transaction ID Data Received for :::: {data}")
|
data = request.get_json()
|
||||||
|
logger.info(f"Retry Transaction ID Data Received for :::: {data}")
|
||||||
|
|
||||||
|
transactionId = data["transactionId"]
|
||||||
|
logger.info(f"Starting Transaction ID Data Received for :::: {transactionId}")
|
||||||
|
|
||||||
|
logger.info(f"Calling Disbursement Components for Retry Transaction ID Data Received for :::: {transactionId}")
|
||||||
|
loan = LoanService.get_loan_by_transaction_id(transactionId)
|
||||||
|
if not loan:
|
||||||
|
logger.info(f"No loan found without disbursement date")
|
||||||
|
return 0
|
||||||
|
logger.info(f"Calling DisburseLoan endpoint with data: {loan}")
|
||||||
|
loan_data = loan.to_dict()
|
||||||
|
|
||||||
|
data = {
|
||||||
|
"transactionId": loan_data.get('transactionId'),
|
||||||
|
"FbnTransactionId": loan_data.get('transactionId'),
|
||||||
|
"debtId": str(loan_data.get('debtId')),
|
||||||
|
"customerId": loan_data.get('customerId'),
|
||||||
|
"accountId": loan_data.get('accountId'),
|
||||||
|
"productId": str(loan_data.get('productId', "")),
|
||||||
|
"provideAmount": loan_data.get('currentLoanAmount'),
|
||||||
|
}
|
||||||
|
response = SimbrellaClient.disburse_loan(data)
|
||||||
|
# return response
|
||||||
|
logger.info(f"Retry Disbursement Transaction ID Result Received for :::: {response}")
|
||||||
|
return ResponseHelper.success(message="Retry Disbursement Request Sent Successfully", status_code=200)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Failed to call retry disbursement {data}: {e}")
|
||||||
|
|
||||||
transactionId = data["transactionId"]
|
|
||||||
logger.info(f"Starting Transaction ID Data Received for :::: {transactionId}")
|
|
||||||
|
|
||||||
logger.info(f"Calling Disbursement Components for Retry Transaction ID Data Received for :::: {transactionId}")
|
|
||||||
loan = LoanService.get_loan_by_transaction_id(transactionId)
|
|
||||||
if not loan:
|
|
||||||
logger.info(f"No loan found without disbursement date")
|
|
||||||
return 0
|
|
||||||
logger.info(f"Calling DisburseLoan endpoint with data: {loan}")
|
|
||||||
loan_data = loan.to_dict()
|
|
||||||
|
|
||||||
data = {
|
|
||||||
"transactionId": loan_data.get('transactionId'),
|
|
||||||
"FbnTransactionId": loan_data.get('transactionId'),
|
|
||||||
"debtId": str(loan_data.get('debtId')),
|
|
||||||
"customerId": loan_data.get('customerId'),
|
|
||||||
"accountId": loan_data.get('accountId'),
|
|
||||||
"productId": str(loan_data.get('productId', "")),
|
|
||||||
"provideAmount": loan_data.get('currentLoanAmount'),
|
|
||||||
}
|
|
||||||
response = SimbrellaClient.disburse_loan(data)
|
|
||||||
return response
|
|
||||||
|
|
||||||
|
|
||||||
@autocall_bp.route("/direct/loan", methods=["POST"])
|
@autocall_bp.route("/direct/loan", methods=["POST"])
|
||||||
|
|||||||
Reference in New Issue
Block a user