diff --git a/app/utils/auth.py b/app/utils/auth.py index a421ea1..7e69725 100644 --- a/app/utils/auth.py +++ b/app/utils/auth.py @@ -15,11 +15,14 @@ def get_headers(): "username": BANK_CALL_BASIC_AUTH_USERNAME, "password": BANK_CALL_BASIC_AUTH_PASSWORD, } + logger.info(f"Calling Bank Call Auth endpoint: {url}") + logger.info(f"Calling Bank Call Auth endpoint with data: {data}") try: response = requests.post(url, data=data, timeout=10) response.raise_for_status() # Raises HTTPError for 4xx/5xx result = response.json() + logger.info(f"Bank Call Auth Response: {result}") # Check if access_token is present @@ -31,7 +34,7 @@ def get_headers(): "Content-Type": "application/json", "x-api-key": settings.BANK_CALL_API_KEY, "App-Id": settings.BANK_CALL_APP_ID, - "Authorization": result['access_token'] # no Bearer + "Authorization": result['access_token'] } except requests.exceptions.RequestException as e: