#r0ninn

1 messages · Page 1 of 1 (latest)

prisma frigateBOT
gleaming needle
#

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?

tepid gull
#

I'm using NextJs

#

and ngrok to turn on a tunnel for development

gleaming needle
#

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?

tepid gull
#

I'm using ngrok to expose publictly an endpoint

gleaming needle
#

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?

tepid gull
#

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

gleaming needle
#

That secret is not a valid secret

#

it should look like whsec_12345

tepid gull
#

oh

#

how i can get that secret?

#

I was thinking this is the correct

gleaming needle
#

See where it says "signing secret" and "reveal"?

#

click reveal

#

then copy the value you see

tepid gull
#

omg !!

#

is working now

#

thank you so much!