46 lines
1.3 KiB
Python
46 lines
1.3 KiB
Python
from flask import Blueprint, request, jsonify, current_app
|
|
import requests
|
|
from app.config import settings
|
|
from app.helpers.response_helper import ResponseHelper
|
|
from app.utils.auth import get_headers
|
|
from app.utils.logger import logger
|
|
from app.integrations.simbrella import SimbrellaClient
|
|
|
|
autocall_bp = Blueprint("autocall", __name__)
|
|
|
|
@autocall_bp.route("/refresh-verify-disbursement", methods=["GET"])
|
|
def verify_transaction():
|
|
# data = request.json()
|
|
logger.info(f"Calling VerifyTransaction Components")
|
|
|
|
response = SimbrellaClient.verify_transaction()
|
|
|
|
return response
|
|
|
|
@autocall_bp.route("/refresh-disbursement", methods=["GET"])
|
|
def disbursement():
|
|
# data = request.json()
|
|
logger.info(f"Calling Disbursement Components")
|
|
|
|
response = SimbrellaClient.verify_transaction()
|
|
|
|
return response
|
|
|
|
|
|
@autocall_bp.route("/payment-callback", methods=["POST"])
|
|
def payment_callback():
|
|
data = request.get_json()
|
|
logger.info(f"Calling Callback Components")
|
|
|
|
response = SimbrellaClient.payment_callback(data)
|
|
|
|
return response
|
|
|
|
@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[0])
|
|
|
|
return response |