changed webhook 2

This commit is contained in:
rizwanisready
2024-04-24 16:08:40 +05:30
parent dca5ed5f7e
commit 75f1967a90

View File

@@ -222,13 +222,9 @@ class StripeWebhookTest(APIView):
status=status.HTTP_404_NOT_FOUND, message="Transaction not found"
)
except Exception as e:
# Handle any other exceptions
WebhookEvent.objects.create(
event_id=event_id,
status="failed",
error_message=str(e),
event_payload=json.loads(payload), # Optionally store payload for audit
)
webhook_event.status = "failed"
webhook_event.error_message = str(e)
webhook_event.save()
return ApiResponse.error(
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
message="Error processing event",