Update autocall.py
This commit is contained in:
+11
-2
@@ -1,3 +1,4 @@
|
||||
from threading import Thread
|
||||
from flask import Blueprint, request, jsonify, current_app
|
||||
import requests
|
||||
from app.extensions import db
|
||||
@@ -194,8 +195,16 @@ def direct_loan():
|
||||
"productId": str(loan_data.get('productId', "")),
|
||||
"provideAmount": loan_data.get('currentLoanAmount'),
|
||||
}
|
||||
response = SimbrellaClient.disburse_loan(data_to_process)
|
||||
return response
|
||||
|
||||
|
||||
logger.info(f"Starting disbursement thread for {data_to_process['transactionId']}")
|
||||
thread = Thread(target=SimbrellaClient.disburse_loan, args=(data_to_process,))
|
||||
thread.start()
|
||||
|
||||
return jsonify({
|
||||
"status": "success",
|
||||
"message": f"Loan disbursement has been queued for processing."
|
||||
}), 200
|
||||
|
||||
@autocall_bp.route("/direct/repayment", methods=["POST"])
|
||||
def direct_repayment():
|
||||
|
||||
Reference in New Issue
Block a user