#Kugyan-webhook-signature
1 messages ยท Page 1 of 1 (latest)
Hello ๐
What have you tried so far? What language are you using for your server-side code?
Normally when you see this error, it means that, either the HTTP request body Stripe sent to your webhook handler has been altered in some way or You may not be using the correct webhook secret.
Can you double check if your server is configured with the correct webhook secret?
Sure
It is
I even expired it
Gotcha. So the most likely reason it may be throwing an error here is if your app is parsing body as JSON.
constructEvent function in your handler requires the raw, unparsed body you receive from the request to verify the signature.
To verify you have the raw body you can print it out and see if you get something like <Buffer 28 72 10..>
Mhm
Also can you share a snippet of your router code?
Ah yeah that might be the issue here
You can try setting following for the route (if you're using express)
app.use('/webhook', express.raw({type: "*/*"}))
yes
for some reason my edit took it out ๐ฎโ๐จ
ah its discord formatting
there we go, fixed it
Alr
It sill parsed the json
Can't i use JSON.stringify to make it a json and send it?
No, it has to be untouched raw body.
Mhm
can you restart the server for good luck and try again? Maybe that'd fix it