#r0ninn
1 messages · Page 1 of 1 (latest)
Hey there, have you had webhooks working with signature verification before?
ie, is this a change in behaviour, or an issue you're running into when trying t do this the first time?
No, never. Is my first time
I'm using NextJs
and ngrok to turn on a tunnel for development
Here is the entire code if you need it
Ok, and are you using the CLI to forward these events to a local server?
Or are you receiving them directly from stripe to a public endpoint?
this one
I'm using ngrok to expose publictly an endpoint
OK, so then I would suggest you log the parameters of constructEvent to ensure all values are populated as expected
Do all of body, signature, webhookSecret have values?
Ok, give me 1 min
{
body: <Buffer 7b 0a 20 20 22 69 64 22 3a 20 22 65 76 74 5f 31 4e 76 33 46 46 42 41 71 49 65 73 45 62 62 30 37 68 4a 65 6e 76 73 42 22 2c 0a 20 20 22 6f 62 6a 65 63 ... 2692 more bytes>,
signature: 't=1695842281,v1=28f36cf743c59aceedc5d96ce1cd7df33a2868c2c35000fa0f0567b87d57fb0d,v0=cb0cd49a97f80ed73274019cc549ab24835334fbc0e442a14e9a7356c387ea3f',
webhookSecret: 'we_1Nv1GkBAqIesEbb0D9ioBN4Q'
}
In this case I'm using a log like this console.log({ body, signature, webhookSecret }) thats why the result includes body, signature, webhookSecret keys