Merge branch 'test' of DigiFi/digifi-EventManager into master
This commit is contained in:
+4
-1
@@ -15,11 +15,14 @@ def get_headers():
|
|||||||
"username": BANK_CALL_BASIC_AUTH_USERNAME,
|
"username": BANK_CALL_BASIC_AUTH_USERNAME,
|
||||||
"password": BANK_CALL_BASIC_AUTH_PASSWORD,
|
"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:
|
try:
|
||||||
response = requests.post(url, data=data, timeout=10)
|
response = requests.post(url, data=data, timeout=10)
|
||||||
response.raise_for_status() # Raises HTTPError for 4xx/5xx
|
response.raise_for_status() # Raises HTTPError for 4xx/5xx
|
||||||
result = response.json()
|
result = response.json()
|
||||||
|
|
||||||
logger.info(f"Bank Call Auth Response: {result}")
|
logger.info(f"Bank Call Auth Response: {result}")
|
||||||
|
|
||||||
# Check if access_token is present
|
# Check if access_token is present
|
||||||
@@ -31,7 +34,7 @@ def get_headers():
|
|||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"x-api-key": settings.BANK_CALL_API_KEY,
|
"x-api-key": settings.BANK_CALL_API_KEY,
|
||||||
"App-Id": settings.BANK_CALL_APP_ID,
|
"App-Id": settings.BANK_CALL_APP_ID,
|
||||||
"Authorization": result['access_token'] # no Bearer
|
"Authorization": result['access_token']
|
||||||
}
|
}
|
||||||
|
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user