#akashpatil7596_webhooks

1 messages ยท Page 1 of 1 (latest)

glass prawnBOT
slender skiffBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

glass prawnBOT
#

๐Ÿ‘‹ 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/1233365731727638590

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

amber furnace
#

Hello

slender skiffBOT
acoustic gulch
#

๐Ÿ‘‹ happy to help

#

have you checked your server logs as my colleague suggested?

amber furnace
#

No I don't even know what does that means?

acoustic gulch
#

@amber furnace there's a limit to what we can help you with on this channel

#

you need to either add logs to your sever or add more details to the response you send to Stripe

#

anyways 400s are basically related to signature mismatches

#

if you don't have problem with your local listener but you have on your registered endpoint it might be because you're using the wrong webhook endpoint secret

amber furnace
#

No I'm using exactly the same your colleague suggested

acoustic gulch
#

using what?

#

the webhook secret looks like whsec_xxxx

#

if that's not what you're using then it's not the right one

#

please don't share it publically

#

and did you deploy it?

amber furnace
#

okay sorry

amber furnace
acoustic gulch
#

that's the one you're using whsec_NdgKixxxEZZHD ?

#

could you share your code please?

amber furnace
#

Yes

acoustic gulch
#

if you're try catching in the calling function you don't have to try catch in this function

#

otherwise the error message won't be logged

amber furnace
#

Sorry I don't understand

acoustic gulch
#

and retry

#

or instead of return error, do throw error

amber furnace
#

okay

#

I think It's validating the webhook

#

but still

#

man... ,what is the issue

#

I'm using stripe secret key of my test account, is that right?

acoustic gulch
# amber furnace

instead of doing res.sendStatus(400); replace that with

res.status(400).send({
  webhookSecret: <copy the one from the first console.lolog>,
message: err.message});
#

this way we can be sure to know which secret and what the error message

#

on the Stripe Dashboard

amber furnace
#

I'm getting this in log

ember seal
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

acoustic gulch
#

you're using the CLI whsec ๐Ÿคฆ

amber furnace
#

means?

#

sorry I didn't understand

#

Helllllo

ember seal
#

My colleague is suggesting, now that you've printed out your webhook secret, it is evident that it's not the one you were supposed to use, as was suspected earlier. Hence the errors.

amber furnace
#

oh yes sorry

#

Now I change it

#

but still

#

Can you tell me what have I doing wrong?

ember seal
acoustic gulch
#

@amber furnace you're using ngrok right?

#

are you still running the ngrok command? did it stop at some point? did the URL change?

#

the reason why I'm thinking about that, because I just saw something we all missed which is the Timeout error in the event's Response, which means that Stripe tried reaching your webhook URL and it didn't find it

#

another thing that might be wrong is something you didn't share in your code

#

would you mind sharing your webhook endpoint code (as text rather than images please)

#

just the stripeWebhook function

amber furnace
#

the logs in stripe dashboard still shows 400 or timeout but somehow my code starts working

#

I mean the code after validating the webhook

acoustic gulch
#

ok then the new 400s must be from the stripe CLI

amber furnace
#

means?

acoustic gulch
#

you shouldn't run stripe listen and register a webhook that reference the same code base

slender skiffBOT