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})