57 lines
1.7 KiB
Python
57 lines
1.7 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():
|
|
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")
|
|
""" data = {
|
|
"transactionId": "TRX1749033507722975",
|
|
"FbnTransactionId":"TRX1748643654575327",
|
|
"debtId": "94696900",
|
|
"customerId": "CID00000559140T",
|
|
"accountId": "ACC20267810160T",
|
|
"productId": "3MPC",
|
|
"provideAmount": 10000.0,
|
|
"collectAmountInterest": 19.0,
|
|
"collectAmountMgtFee": 66.0,
|
|
"collectAmountInsurance": 66.0,
|
|
"collectAmountVAT": 75.00,
|
|
"countryId": "01",
|
|
"comment": "Loan Disbursement"
|
|
}"""
|
|
response = SimbrellaClient.disburse_loan()
|
|
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 |