From 643249a30d98d4159a4c6f4b5367a1ad925f9b41 Mon Sep 17 00:00:00 2001 From: "oluyemi.a.simbrellang.com" Date: Mon, 14 Apr 2025 14:01:57 +0100 Subject: [PATCH] done with payment callback service --- app/integrations/simbrella.py | 21 ++++++++++++++++++++- app/routes/autocall.py | 5 ++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/integrations/simbrella.py b/app/integrations/simbrella.py index d1f0f2f..073e7d2 100644 --- a/app/integrations/simbrella.py +++ b/app/integrations/simbrella.py @@ -110,7 +110,7 @@ class SimbrellaClient: try: logger.info(f"Here is your Disbursement Request data ***** : {data}") # response = requests.post(api_url, json=data, headers=get_headers()) - logger.info(f"Disbursement response: {response.json()}") + # logger.info(f"Disbursement response: {response.json()}") # return response.json() @@ -119,3 +119,22 @@ class SimbrellaClient: except Exception as e: logger.info(f"Failed to call Disbursement endpoint: {e}") raise + + @staticmethod + def payment_callback(data): + api_url = f"{SimbrellaClient.BANK_CALL_BASE_URL}/Payment" + logger.info(f"BANK_CALL_BASE_URL = {SimbrellaClient.BANK_CALL_BASE_URL}") + logger.info(f"Calling Payment Callback endpoint with data: {data}") + + try: + logger.info(f"Here is your Payment Callback Request data ***** : {data}") + # response = requests.post(api_url, json=data, headers=get_headers()) + # logger.info(f"Payment Callback response: {response.json()}") + + # return response.json() + + return data + + except Exception as e: + logger.info(f"Failed to call Payment Callback endpoint: {e}") + raise \ No newline at end of file diff --git a/app/routes/autocall.py b/app/routes/autocall.py index 8d6aba8..75eddf3 100644 --- a/app/routes/autocall.py +++ b/app/routes/autocall.py @@ -30,4 +30,7 @@ def disbursement(): def payment_callback(): data = request.json() logger.info(f"Calling Callback Components") - return jsonify(data), 200 \ No newline at end of file + + response = SimbrellaClient.payment_callback(data) + + return jsonify(response), 200 \ No newline at end of file