#_webhooks
1 messages · Page 1 of 1 (latest)
đź‘‹ Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đź”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1377489142602141837
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Unfortunately I know nothing about coding tbh, so using ai to code it then troubleshoot it has been a pain in the bum
hello! Looking at that event that you shared with us. Your application is responding with
Webhook Error: No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe?
Learn more about webhook signing and explore webhook integration examples for various frameworks at https://github.com/stripe/stripe-node#webhook-signing
I'm guessing you're probably using Express.js. When you're using Express.js - the sequence of middleware matters. Does your node middleware configure parsing all the requests to JSON somewhere? For example, if you have app.use(express.json()); prior to your route, this will parse the requests in all JSON, not in raw form before reaching to your webhook function.
To be clear, we expect users in this channel to have a solid understanding of coding. This is a developer channel, so you’ll need to put in the effort to understand what you’re building.
I understand, however, this is me putting in the effort the understand what I am building
this is in my server.js
can you see any obvious issues that would prevent the events from working in the webhook
hmmm, that looks correct from a quick glance to me. Can you log the last 4 of your webhook secret which you're using to do signature verification?
last 4 logs or last 4 digits
last 4 digits
oh wait, onesec
your originalUrl is /api/webhook/stripe, but your route is using /api/webhook
ah, so it should be the same as the original url?
maybe try changing your originalUrl to /api/webhook
and then try again to see if you're still running into the same issue
does that mean I have to change the destination of the webhood endpoint url to just be /api/webhook rather than /api/webhook/stripe ?
or just changing it in the code should be fine?
hey @thick leaf , your webhook endpoint ends with api/webhook/stripe, so I believe the path you declared in your app.use() needs to be the same.
thank you , I'll try this and tell you if it works
I have appended it to match the /api/webhook/stripe
unfortunately I still get this issue
You have ensured that your webhook secret is correct, right?
yes I have