Verify transation s

This commit is contained in:
CHIEFSOFT\ameye
2025-05-31 21:44:52 -04:00
parent 1a4f0c1332
commit 9fc3104c79
3 changed files with 23 additions and 11 deletions
+22 -8
View File
@@ -15,6 +15,7 @@ class SimbrellaClient:
BANK_CALL_BASE_URL = settings.BANK_CALL_BASE_URL
BANK_CALL_DISBURSE_LOAN_ENDPOINT = settings.BANK_CALL_DISBURSE_LOAN_ENDPOINT
BANK_CALL_COLLECT_LOAN_ENDPOINT = settings.BANK_CALL_COLLECT_LOAN_ENDPOINT
BANK_CALL_TRANSACTION_VERIFY = settings.BANK_CALL_TRANSACTION_VERIFY
@staticmethod
def disburse_loan(data):
@@ -85,6 +86,7 @@ class SimbrellaClient:
@staticmethod
def collect_loan(data):
api_url = f"{SimbrellaClient.BANK_CALL_BASE_URL}/{SimbrellaClient.BANK_CALL_COLLECT_LOAN_ENDPOINT}"
logger.info(f"Calling CollectLoan api_url==> : {api_url}")
logger.info(f"Calling CollectLoan endpoint with data: {data}")
# Check if the repayment exists
@@ -107,7 +109,7 @@ class SimbrellaClient:
"fbnTransactionId": loan.reference,
"debtId": repayment.loan_id,
"customerId": repayment.customer_id,
"accountId": loan.account,
"accountId": loan.account_id,
"productId": repayment.product_id,
"collectAmount": collectAmount,
"penalCharge": 0,
@@ -131,17 +133,29 @@ class SimbrellaClient:
@staticmethod
def verify_transaction():
try:
api_url = f"{SimbrellaClient.BANK_CALL_BASE_URL}/{SimbrellaClient.BANK_CALL_DISBURSE_LOAN_ENDPOINT}"
logger.info(f"Calling TransactionVerify api_url==> : {api_url}")
data = {
"status": "00",
"message": "Transaction verified"
}
return ResponseHelper.success(data, "Successful")
verify_data = {
"channel": "string",
"accountId": "string",
"customerId": "string",
"transactionId": "string",
"transactionType": "string",
"countryId": "string",
"requestId": "string"
}
try:
logger.info(f"Here is your TransactionVerify Request data ****** : {verify_data}")
response = requests.post(api_url, json=verify_data, timeout=10, headers=get_headers())
logger.info(f"TransactionVerify Response: {response.json()}")
return ResponseHelper.success(response, "Successful")
except Exception as e:
logger.info(f"Failed to call TransactionVerify endpoint: {e}")
raise
return 0
@staticmethod
def refresh_disbursement(data):