move action to SimbrellaClient integration
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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
|
||||
Reference in New Issue
Block a user