[add]: RACCHECK
This commit is contained in:
@@ -4,6 +4,7 @@ from app.api.services.base_service import BaseService
|
||||
from app.api.schemas.eligibility_check import EligibilityCheckSchema
|
||||
from marshmallow import ValidationError
|
||||
from app.api.enums import TransactionType
|
||||
from app.api.integrations import SimbrellaClient
|
||||
|
||||
class EligibilityCheckService(BaseService):
|
||||
TRANSACTION_TYPE = TransactionType.ELIGIBILITY_CHECK
|
||||
@@ -40,6 +41,19 @@ class EligibilityCheckService(BaseService):
|
||||
"message": "Invalid Customer or Account"
|
||||
}), 400
|
||||
|
||||
# Call RACCheck
|
||||
response = SimbrellaClient.rac_check(
|
||||
customer_id=customer_id,
|
||||
account_id=account_id,
|
||||
transaction_id=validated_data.get("transactionId"),
|
||||
country_code=validated_data.get("countryCode"),
|
||||
msisdn=validated_data.get("msisdn")
|
||||
)
|
||||
|
||||
if "error" in response or response.get("status") != 200:
|
||||
return jsonify({"message": "RACCheck failed", "error": response.get("message", response)}), 400
|
||||
|
||||
|
||||
|
||||
offers = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user