changed webhook 2
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user