58 lines
1.8 KiB
Python
58 lines
1.8 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 = {
|
|
"requestId": "TRX1747399791142408",
|
|
"transactionId": "TRX1747399791142408",
|
|
"FbnTransactionId":"TRX1747399791142408",
|
|
"debtId": "9451",
|
|
"customerId": "CUC1696296013",
|
|
"accountId": "ACC8112865094",
|
|
"productId": "AMPC",
|
|
"provideAmount": 6600.0,
|
|
"collectAmountInterest": 198.0,
|
|
"collectAmountMgtFee": 66.0,
|
|
"collectAmountInsurance": 66.0,
|
|
"collectAmountVAT": 4.95,
|
|
"countryId": "01",
|
|
"comment": "Loan Disbursement"
|
|
}
|
|
response = SimbrellaClient.disburse_loan(data)
|
|
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 |