fix(views-verifypayment): improve error handling in payment verification process 🐛
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 5m23s

This commit is contained in:
2025-07-05 16:24:10 +05:00
parent e85d605454
commit 48bde9d52b

View File

@ -220,15 +220,18 @@ class VerifyPaymentView(StaffEditorPermissionMixin, generics.UpdateAPIView):
raise ValueError(
"PAYMENT_BASE_URL is not set. Please set it in your environment variables."
)
logger.info(data)
response = requests.post(
f"{PAYMENT_BASE_URL}/verify-payment",
json=data,
headers={"Content-Type": "application/json"},
)
try:
response.raise_for_status()
except requests.exceptions.HTTPError as e:
logger.error(f"HTTPError: {e}")
return False
mib_resp = response.json()
print(mib_resp)
logger.info("MIB Verification Response ->", mib_resp)
if not response.json().get("success"):
return mib_resp["success"]
else: