diff --git a/app/integrations/simbrella.py b/app/integrations/simbrella.py index 6a38fa8..792746f 100644 --- a/app/integrations/simbrella.py +++ b/app/integrations/simbrella.py @@ -84,4 +84,22 @@ class SimbrellaClient: logger.info(f"Failed to call CollectLoan endpoint: {e}") return 0 - return 1 \ No newline at end of file + return 1 + + @staticmethod + def verify_transaction(data): + BANK_CALL_BASE_URL = "https://bank-emulator.dev.simbrellang.net" + api_url = f"{BANK_CALL_BASE_URL}/TransactionVerify" + logger.info(f"BANK_CALL_BASE_URL = {BANK_CALL_BASE_URL}") + logger.info(f"Calling TransactionVerify endpoint with data: {data}") + + try: + logger.info(f"Here is your TransactionVerify Request data ***** : {data}") + response = requests.post(api_url, json=data, headers=get_headers()) + logger.info(f"TransactionVerify response: {response.json()}") + + return response.json() + + except Exception as e: + logger.info(f"Failed to call TransactionVerify endpoint: {e}") + raise diff --git a/app/routes/autocall.py b/app/routes/autocall.py index 530b8cc..e55d5c6 100644 --- a/app/routes/autocall.py +++ b/app/routes/autocall.py @@ -3,6 +3,7 @@ import requests from app.config import settings from app.utils.auth import get_headers from app.utils.logger import logger +from app.integrations.simbrella import SimbrellaClient autocall_bp = Blueprint("autocall", __name__) @@ -10,7 +11,10 @@ autocall_bp = Blueprint("autocall", __name__) def verify_transaction(): data = request.json() logger.info(f"Calling Verify Components") - return jsonify(data), 200 + + response = SimbrellaClient.verify_transaction(data) + + return jsonify(response), 200 @autocall_bp.route("/refresh-disbursement", methods=["GET"]) def disbursement():