#_webhooks

1 messages · Page 1 of 1 (latest)

toxic flameBOT
#

đź‘‹ 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.

thick leaf
#

Unfortunately I know nothing about coding tbh, so using ai to code it then troubleshoot it has been a pain in the bum

umbral summit
#

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.

thick leaf
#

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

umbral summit
#

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?

thick leaf
#

last 4 logs or last 4 digits

umbral summit
#

last 4 digits

#

oh wait, onesec

#

your originalUrl is /api/webhook/stripe, but your route is using /api/webhook

thick leaf
#

ah, so it should be the same as the original url?

umbral summit
#

maybe try changing your originalUrl to /api/webhook

#

and then try again to see if you're still running into the same issue

thick leaf
#

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?

somber crest
#

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.

thick leaf
#

thank you , I'll try this and tell you if it works

thick leaf
#

I have appended it to match the /api/webhook/stripe

#

unfortunately I still get this issue

somber crest
#

You have ensured that your webhook secret is correct, right?

thick leaf
#

yes I have