#WaDo-webhooks
1 messages · Page 1 of 1 (latest)
Hi! Yes webook signature can be a bit tricky.
Can you try to log the values of req.body, signature, and stripeWebhooksApiKey to check their values?
Also could you replace JSON.stringify(req.body) by just req.body as shown in thos doc? https://stripe.com/docs/webhooks/quickstart
Hi
Find the console log below
body: {
id: 'evt_3KnIJLDV9jNuNMkU2YDehGU6',
object: 'event',
api_version: '2020-08-27',
created: 1649664563,
data: { object: [Object] },
livemode: false,
pending_webhooks: 3,
request: {
id: 'req_kiqskYa32PEJjv',
idempotency_key: '2cbe16a6-6eab-43a9-ba3a-d67d18bcf9bc'
},
type: 'payment_intent.created'
},
signature: 't=1649664563,v1=51f0129b6e1303c7f9c026daba45d70744560976015f17c8ca9e557acf4773f4,v0=a376fa0dc92974817275d835bb3e2f25cf1a7922d17d6ada6f66b4dbf91dfffc',
stripeWebhooksApiKey: 'whsec_cc32e4e88512285d3bcb0544cd2aa4732ab31ac62bc9a944a5303ac4c779ff7a'
}
Can you check that the whsec_*** match the one you see in your dashboard (or in the Stripe CLI if you are soing local testing)?
And have you tried this:
could you replace JSON.stringify(req.body) by just req.body
Yeah it is a local wh_secret
A newer version of the Stripe CLI is available, please update to: v1.8.6
> Ready! You are using Stripe API Version [2020-08-27]. Your webhook signing secret is whsec_cc32e4e88512285d3bcb0544cd2aa4732ab31ac62bc9a944a5303ac4c779ff7a (^C to quit)
So have you tried my suggestion above? Does it work?
Got it. Can you try having a look at thes stackoverflow thread? They mention some solutions: https://github.com/stripe/stripe-node/issues/341