#Robert Fonzarely
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Signature verification shouldn't be affected by that. Few of the common culprits here are
- Your webhook endpoint using an incorrect signing secret
- Your server parsing the raw event body to a different format before it reaches your event handler
Ok, I see. The API server is NextJs, so the webhook takes req.body. Do I have to format the json before checking ?
If you have a parser that runs and formats incoming payloads to let's say JSON then that would be an issue as the constructEvent function expects raw body
The error log show me the correct key
No you shouldn't format it to JSON
It shouldn't be touched.
Typically in node projects, I've seen bodyParser (or something similar) parsing the body automatically.
You'd likely want to configure your route to NOT parse the body.
Thanks, it ring the bell. I'v found a workarround with nextjs : https://www.codedaily.io/tutorials/Stripe-Webhook-Verification-with-NextJS
Ah nice, lmk if you need additional help ๐