1 Commits

Author SHA1 Message Date
VivianDee b69052123a [fix]: SMS destination 2025-11-14 10:18:26 +01:00
2 changed files with 12 additions and 12 deletions
+10 -1
View File
@@ -2,6 +2,7 @@ import requests
from app.config import settings
from app.helpers.response_helper import ResponseHelper
# from app.routes.autocall import verify_transaction
from app.models.customer import Customer
from app.services.loan import LoanService
from app.services.loan_repayment_schedule import LoanRepaymentScheduleService
from app.utils.auth import get_headers
@@ -281,8 +282,16 @@ class SimbrellaClient:
logger.info(f"this is verify result, {result}")
LoanService.set_disburse_verify_result(loan_data['debtId'], result.get('responseCode', ''),
result.get('responseMessage', ''))
customer = Customer.get_customer(loan_data.get('customerId'))
if customer:
misisdn = customer.msisdn
else:
logger.info(f"Customer does not exist for customer id: {loan_data.get('customerId')}")
misisdn = settings.TEST_NO
sms_data = {
"dest": transaction_data.get('phone_number') or settings.TEST_NO,
"dest": misisdn,
"text": f"Transaction {loan_data.get('transactionId')} verified successfully",
"unicode": True
}
+2 -11
View File
@@ -1,4 +1,3 @@
from threading import Thread
from flask import Blueprint, request, jsonify, current_app
import requests
from app.extensions import db
@@ -195,16 +194,8 @@ def direct_loan():
"productId": str(loan_data.get('productId', "")),
"provideAmount": loan_data.get('currentLoanAmount'),
}
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
response = SimbrellaClient.disburse_loan(data_to_process)
return response
@autocall_bp.route("/direct/repayment", methods=["POST"])
def direct_repayment():