From ec32c45dd1098cf76b74bcc6b7dae40b199bc429 Mon Sep 17 00:00:00 2001 From: suro Date: Fri, 27 Mar 2026 22:02:14 +0100 Subject: [PATCH] Final Fix: Use json.loads for webhook event --- AzA march 2026/stripe_routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AzA march 2026/stripe_routes.py b/AzA march 2026/stripe_routes.py index da1e89e..e83f2d3 100644 --- a/AzA march 2026/stripe_routes.py +++ b/AzA march 2026/stripe_routes.py @@ -316,11 +316,11 @@ async def stripe_webhook( body = await request.body() try: - event = stripe.Webhook.construct_event(payload=body, sig_header=stripe_signature, secret=STRIPE_WEBHOOK_SECRET) + stripe.Webhook.construct_event(payload=body, sig_header=stripe_signature, secret=STRIPE_WEBHOOK_SECRET) except Exception as e: raise HTTPException(status_code=400, detail=f"Webhook signature verification failed: {e}") - event = event.to_dict_recursive() + event = json.loads(body) event_id = event.get("id", "") if event_id and _already_processed(event_id): return JSONResponse({"ok": True, "duplicate": True})