Update eligibility_check.py
This commit is contained in:
@@ -73,42 +73,24 @@ class EligibilityCheckService(BaseService):
|
|||||||
|
|
||||||
logger.info(f"This is Response (from Eligibility Check): {str(response)}", exc_info=True)
|
logger.info(f"This is Response (from Eligibility Check): {str(response)}", exc_info=True)
|
||||||
|
|
||||||
# Handle this error response
|
|
||||||
# 2025-05-29 16:23:18,685 - INFO - This is Response (Eligibility Check): {'data': None, 'responseCode': '04', 'responseMessage': 'Error!, Invalid Account Id or Customer Id supplied'}
|
|
||||||
|
|
||||||
# {
|
if not response or response['responseCode'] != '00':
|
||||||
# "data": {
|
|
||||||
# "customerId": "244011885",
|
if response:
|
||||||
# "accountId": "TE45702360",
|
logger.error(f"{response['responseMessage']}")
|
||||||
# "transactionId": "250526144645534567CC3B01",
|
|
||||||
# "racResponse": {
|
return ResponseHelper.error(result_description=f"Failed to save RACCheck")
|
||||||
# "hasSalaryAccount": true,
|
|
||||||
# "bvnValidated": true,
|
rack_checks_response = response['data']['racResponse']
|
||||||
# "crmsCheck": true,
|
|
||||||
# "creditBureauCheck": true,
|
|
||||||
# "hasPastDueLoan": true,
|
|
||||||
# "hasLien": true,
|
|
||||||
# "accountStatus": true,
|
|
||||||
# "noBouncedCheck": true,
|
|
||||||
# "isWhitelisted": true
|
|
||||||
# }
|
|
||||||
# },
|
|
||||||
# "responseCode": "00",
|
|
||||||
# "responseMessage": "Operation Successful"
|
|
||||||
# }
|
|
||||||
|
|
||||||
rac_check = RACCheck.add_rac_check(
|
rac_check = RACCheck.add_rac_check(
|
||||||
customer_id = customer_id,
|
customer_id = customer_id,
|
||||||
account_id = account_id,
|
account_id = account_id,
|
||||||
transaction_id = transaction.transaction_id,
|
transaction_id = transaction.transaction_id,
|
||||||
data = response['racResponse']
|
data = rack_checks_response
|
||||||
)
|
)
|
||||||
|
|
||||||
if not rac_check:
|
|
||||||
logger.error(f"Failed to save RACCheck")
|
|
||||||
return ResponseHelper.error(result_description="Failed to save RACCheck.")
|
|
||||||
|
|
||||||
rack_checks_response = response['racResponse']
|
|
||||||
# -----------------TIME FOR ANALYSIS TO REGISTER OFFER ----------------------
|
# -----------------TIME FOR ANALYSIS TO REGISTER OFFER ----------------------
|
||||||
# eligible_offers = []
|
# eligible_offers = []
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user