#Sachin_
1 messages Β· Page 1 of 1 (latest)
π Hi there, Happy to help!
Could you please share more details about the error (maybe the requestId if you are using API or screenshot)
Hi
Okay I'll send you screenshot
But my question is for webhook i just need to add url in dashboard?
Or i have to do more configuration.
It depends on the error, you endpoint must be correctly configured for handling HTTPS, because Stripe validates that the connection to your server is secure before sending your webhook data.
What TLS version are you using? because Stripe webhooks donβt currently support TLS v1.3
Did you tried to check your TLS configuration of your endpoint? you can use this one to do so:
https://www.ssllabs.com/ssltest/
I am using local url with ngrok will that work ?
you need to check if the generated url by ngrok is a valid HTTPS endpoint or not using the website I shared with you above
Okay checking...
but AFAIK https://glitch.com/ generated urls are supported if that could help your tests
type: 'StripeSignatureVerificationError', raw: { message: 'No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? https://github.com/stripe/stripe-node#webhook-signing',
Error i am getting
Ok so it's not a certificate error in your endpoint
you need to make sure that you have no parser/middleware that are modifying the request body
If you are using a global json middle in your nodeJs, you can follow this example to exempt webhook endpoint from being parsed:
https://github.com/stripe/stripe-node/blob/master/examples/webhook-signing/node-express/express.js#L10
Are you updating the webhook secret when switching to ngrok ?
You should use the webhook secret generated in the dashboard when creating the webhook, and not the one shown in the console by the stripe-cli command
yes
Yes it is same everytime
Can you share your webhook code please
Issue is likely in your route handler. Is this Express?
Yes
Also i added middleware for raw
But it only fails if i am not using tha comand i told you above
I don't see it there, can you share the actual code that's running (paste it please, not a screenshot)
Which command works?
This code is running only if
Stipe listen --forword -to mylocal url
If i stop this command then getting this error.
This error
Getting this error where?
Here for this route i am using middle ware raw.
In stripe.webhooks.consturctEvent function catch block
Line number 52 in screenshot
Yes, but I'm confused in which scenario it works and what doesn't. Can you share the actually command you run that work and that don't work
We can connect any other way ?
I'm afraid not. Alternatively you can write in: https://support.stripe.com/contact and our team can help
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
If i write stripe cli
stripe listen --forward to ngrok.xysz.com/stripe/webhook
If i am running this command and triggering events
Everything works fine
If i stop this command then i am getting error i told you
Can you share an evt_xx ID?
Taking a look now, sorry
Ok, so it looks like there's delivery issues to your ngrok endpoint (https://2c4b-14-97-58-238.in.ngrok.io/stripe/webhook) which is configured as a webhook on your account via the Dashboard (separate to the CLI): https://dashboard.stripe.com/test/webhooks/we_1Ls2XMSAM0x0RJ7U0mW4ph8P
This means it has a different whsec_xxx secret to the one omitted by the CLI
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
And likely explains the error, as you're passing the one from the CLI to the constructEvent function
How can i fix this ?
You need to use the whsec_xxx from the Dashboard URL I sent above when processing events that aren't forwarded by the CLI
Okay got it thank you so much ππ»
np!