[add]: loan charges and offers. Fix RACCheck
This commit is contained in:
@@ -36,6 +36,7 @@ class SimbrellaIntegration:
|
||||
}
|
||||
|
||||
logger.error(f"This is PayLoad: {str(payload)}",exc_info=True)
|
||||
|
||||
headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'x-api-key': f'{settings.VALID_API_KEY}',
|
||||
@@ -44,12 +45,10 @@ class SimbrellaIntegration:
|
||||
|
||||
try:
|
||||
response = requests.post(url, json=payload, timeout=10, headers=headers)
|
||||
|
||||
logger.error(f"This is Response: {str(response)}", exc_info=True)
|
||||
# Raise an error for non-200 responses
|
||||
if response.status_code != 200:
|
||||
response.raise_for_status()
|
||||
|
||||
return response.json()
|
||||
except requests.exceptions.RequestException as err:
|
||||
logger.error(f"RACCheck API call failed: {str(err)}", exc_info=True)
|
||||
return {"error": "RACCheck API error"}
|
||||
except Exception as e:
|
||||
logger.error(f"RACCheck API call failed: {str(e)}", exc_info=True)
|
||||
raise Exception(f"RACCheck API call failed: {str(e)}")
|
||||
|
||||
Reference in New Issue
Block a user