[add]: RACCHECK

This commit is contained in:
VivianDee
2025-03-31 16:24:05 +01:00
parent d9c99627ae
commit c826bdc36b
5 changed files with 57 additions and 1 deletions
+14
View File
@@ -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 = [
{