[add]: Simbrella integration
This commit was merged in pull request #2.
This commit is contained in:
@@ -19,3 +19,5 @@ DATABASE_NAME=*****
|
|||||||
FLASK_APP=wsgi.py
|
FLASK_APP=wsgi.py
|
||||||
FLASK_ENV=development
|
FLASK_ENV=development
|
||||||
APP_PORT=4500
|
APP_PORT=4500
|
||||||
|
|
||||||
|
SIMBRELLA_BASE_URL=***************
|
||||||
@@ -6,7 +6,7 @@ class SimbrellaClient:
|
|||||||
BASE_URL = settings.SIMBRELLA_BASE_URL
|
BASE_URL = settings.SIMBRELLA_BASE_URL
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def rac_check(customer_id, account_id, transaction_id, country_code, msisdn):
|
def rac_check(customer_id, account_id, transaction_id):
|
||||||
"""
|
"""
|
||||||
Calls the RACCheck endpoit
|
Calls the RACCheck endpoit
|
||||||
"""
|
"""
|
||||||
@@ -16,8 +16,21 @@ class SimbrellaClient:
|
|||||||
"customerId": customer_id,
|
"customerId": customer_id,
|
||||||
"accountId": account_id,
|
"accountId": account_id,
|
||||||
"transactionId": transaction_id,
|
"transactionId": transaction_id,
|
||||||
"countryCode": country_code,
|
"RAC_Array": [
|
||||||
"msisdn": msisdn
|
{
|
||||||
|
"salaryAccount": True,
|
||||||
|
"bvn": "12345678901",
|
||||||
|
"crc": False,
|
||||||
|
"crms": True,
|
||||||
|
"accountStatus": "active",
|
||||||
|
"lien": False,
|
||||||
|
"noBouncedCheck": True,
|
||||||
|
"existingLoan": False,
|
||||||
|
"whitelist": True,
|
||||||
|
"noPastDueSalaryLoan": True,
|
||||||
|
"noPastDueOtherLoans": False
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -43,11 +43,9 @@ class EligibilityCheckService(BaseService):
|
|||||||
|
|
||||||
# Call RACCheck
|
# Call RACCheck
|
||||||
response = SimbrellaClient.rac_check(
|
response = SimbrellaClient.rac_check(
|
||||||
customer_id=customer_id,
|
customer_id = customer_id,
|
||||||
account_id=account_id,
|
account_id = account_id,
|
||||||
transaction_id=validated_data.get("transactionId"),
|
transaction_id = transaction.id,
|
||||||
country_code=validated_data.get("countryCode"),
|
|
||||||
msisdn=validated_data.get("msisdn")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if "error" in response or response.get("status") != 200:
|
if "error" in response or response.get("status") != 200:
|
||||||
|
|||||||
Reference in New Issue
Block a user