diff --git a/billing/views.py b/billing/views.py index a32a2e1..53ebea7 100644 --- a/billing/views.py +++ b/billing/views.py @@ -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"}, ) - response.raise_for_status() + 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: