26 lines
650 B
Python
26 lines
650 B
Python
import requests
|
|
from app.config import settings
|
|
from app.utils.auth import get_headers
|
|
from app.utils.logger import logger
|
|
from flask import jsonify
|
|
|
|
class SimbrellaClient:
|
|
|
|
BASE_URL = settings.BANK_CALL_BASE_URL
|
|
|
|
@staticmethod
|
|
def disbursement(data):
|
|
|
|
api_url = f"{SimbrellaClient.BASE_URL}/Disbursement"
|
|
|
|
logger.info(f"Calling disbursement endpoint with data: {data}")
|
|
|
|
response = requests.post(
|
|
api_url,
|
|
json=data,
|
|
headers=get_headers()
|
|
)
|
|
|
|
logger.info(f"Disbursement response: {response.json()}")
|
|
|
|
return jsonify(response.json()), response.status_code |