add endpoint for penal charge

This commit is contained in:
2025-04-17 17:26:59 +01:00
parent d2e272e44b
commit 0bc71f8108
4 changed files with 68 additions and 6 deletions
+12 -1
View File
@@ -71,7 +71,6 @@ class SimbrellaClient:
except Exception as e:
logger.info(f"Failed to call Disbursement endpoint: {e}")
#raise
return 0
return 1
@@ -150,6 +149,18 @@ class SimbrellaClient:
return data
except Exception as e:
logger.info(f"Failed to call Payment Callback endpoint: {e}")
raise
@staticmethod
def penal_charge(data):
try:
logger.info(f"Here is your Penal Charge Request data ***** : {data}")
return data
except Exception as e:
logger.info(f"Failed to call Payment Callback endpoint: {e}")
raise
+4 -4
View File
@@ -15,7 +15,7 @@ def health():
@auth_bp.route("/login", methods=["POST"])
def login():
data = request.json
data = request.get_json()
api_url = f"{BASE_URL}/login"
response = requests.post(api_url, json=data)
@@ -26,7 +26,7 @@ def login():
@auth_bp.route("/status-call", methods=["POST"])
def status_call():
data = request.json
data = request.get_json()
api_url = f"{BASE_URL}/StatusCall"
# response = requests.post(api_url, json=data, headers=get_headers())
@@ -49,7 +49,7 @@ def status_call():
@auth_bp.route("/sms", methods=["POST"])
def sms():
data = request.json
data = request.get_json()
api_url = f"{BASE_URL}/SMS"
# response = requests.post(api_url, json=data, headers=get_headers())
@@ -66,7 +66,7 @@ def sms():
@auth_bp.route("/bulk-sms", methods=["POST"])
def bulk_sms():
data = request.json
data = request.get_json()
api_url = f"{BASE_URL}/BulkSMS"
# response = requests.post(api_url, json=data, headers=get_headers())
+10 -1
View File
@@ -28,9 +28,18 @@ def disbursement():
@autocall_bp.route("/payment-callback", methods=["POST"])
def payment_callback():
data = request.json()
data = request.get_json()
logger.info(f"Calling Callback Components")
response = SimbrellaClient.payment_callback(data)
return jsonify(response), 200
@autocall_bp.route("/penal-charge", methods=["POST"])
def penal_charge():
data = request.get_json()
logger.info(f"Calling Penal Charge Endpoints")
response = SimbrellaClient.penal_charge(data)
return jsonify(response), 200
+42
View File
@@ -113,6 +113,48 @@ paths:
/autocall/payment-callback:
get:
summary: The Payment callback
responses:
200:
description: A successful response
/autocall/penal-charge:
post:
summary: Penal Charge Request
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
type: object
properties:
transactionId:
type: string
example: "T004"
fbnTransactionId:
type: string
example: "Tr201712RK9232P115"
debtId:
type: string
example: "273194670"
customerId:
type: string
example: "CN621868"
accountId:
type: string
example: "2017821799"
penalCharge:
type: number
example: "1.2"
lienAmount:
type: number
example: "101.2"
countryId:
type: string
example: "01"
comment:
type: string
example: "Testing PenalCharge"
responses:
200:
description: A successful response