44 lines
1.2 KiB
Python
44 lines
1.2 KiB
Python
from flask import Blueprint, request, jsonify, current_app
|
|
from app.config import settings
|
|
import requests
|
|
from app.utils.auth import get_headers
|
|
|
|
eligibility_bp = Blueprint("eligibility", __name__)
|
|
|
|
BASE_URL = settings.BANK_CALL_BASE_URL
|
|
|
|
|
|
@eligibility_bp.route("/check", methods=["POST"])
|
|
def eligibility_check():
|
|
data = request.json
|
|
api_url = f"{BASE_URL}/EligibilityCheck"
|
|
|
|
# response = requests.post(api_url, json=data, headers=get_headers())
|
|
# return jsonify(response.json()), response.status_code
|
|
response = {
|
|
"customerId": "CN621868",
|
|
"transactionId": "Tr201712RK9232P115",
|
|
"countryCode": "NGR",
|
|
"msisdn": "2348012345678",
|
|
"eligibleOffers": [
|
|
{
|
|
"offerId": 101,
|
|
"minAmount": 5000,
|
|
"maxAmount": 20000,
|
|
"productId": 2030,
|
|
"tenor": 30,
|
|
},
|
|
{
|
|
"offerId": 102,
|
|
"minAmount": 20000,
|
|
"maxAmount": 50000,
|
|
"productId": 2090,
|
|
"tenor": 90,
|
|
},
|
|
],
|
|
"resultCode": "00",
|
|
"resultDescription": "Successful",
|
|
}
|
|
|
|
return jsonify(response), 200
|