#alanac_webhooks

1 messages ยท Page 1 of 1 (latest)

solemn questBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!

๐Ÿ”— 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/1212828163294363660

๐Ÿ“ Have more to share? You can add more detail below, including code, screenshots, videos, etc.

โฒ๏ธ 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. Thank you for your patience!

visual jayBOT
neat oar
#

When you switched to live mode you need to switch the webhook secret to match the one tied to your livemode webhook endpoint - I assume you originally were using the webhook secret created for your testmode endpoint, which wouldn't be the same

#

@tulip terrace Please respond here and not in other threads ๐Ÿ™‚

tulip terrace
#

can you tell me where I can find this other secret? I'm currently using the key in the "signing secret".

neat oar
#

Are you in live mode or test mode in the dashboard right now?

tulip terrace
#

In live mode

neat oar
#

Hmm... can you try logging the secret from your code and confirm it ends in "Ub8" ?

tulip terrace
#

yes, that's right

neat oar
#

That's after you log it from your code, right?

tulip terrace
#

yes

neat oar
#

Gotcha - can you give me more details on how you were testing earlier? Were you using the CLI?

tulip terrace
#

Yes, until now, all my tests were done with the CLI, and there were never any problems with this, only when I moved to Vercel and started using it in production did this error appear. I don't know if there's some other detail I've overlooked, or if the point really is the key, because theoretically, you just have to change it to the live code key, right?

neat oar
#

I've had some past vercel users that were having issues with the environment variables not correctly updating the the new secret, but if you've logged your key from your code and confirmed it's correct then that shouldn't be the issue

tulip terrace
#

Yes, the Vercel already has the live mode key. If you have any other information that might help, I can send it to you

neat oar
#

At this point, you need to do some debugging on your end - I'd recommend logging the full raw payload, signature, and webhook secret you pass through to the signature verification call so we can see if anything is wrong

#

Also if you can share what your signature verification code looks like that would help

tulip terrace
#

Okay, I'll send you the code screenshots

#

one minute

#

below I'll make a switch case with the event types, would you like to see it too?

neat oar
#

No, that's not necessary - I just need to see your signature verification code

#

I don't see you logging your webhook secret there

tulip terrace
#

My webhook secret is in an env file, set in const webhookSecret, on line 17

neat oar
#

Yes, but I asked you to log it from your code to make sure your code is pulling the correct secret

tulip terrace
#

ooh, okay, I didn't understand, sorry

#

I don't know what I did differently now, I just added console.log to get the signature and secret of the webhook, and uploaded it to Vercel, and now it works. Finally some good news, I'm happier ๐Ÿ™Œ

#

Anyway, I'll also try it out as you said, to confirm

neat oar
#

hurray! I'm guessing vercel was looking at an outdated version of your environment variables (maybe you forgot to redeploy) and when you uploaded the changes to vercel it allowed the new values to kick in

tulip terrace
#

hmm, that must have been it, I've been thinking about it for a while ๐Ÿ˜…

#

Anyway, thank you very much for your help

neat oar
#

glad we could get that sorted out!

tulip terrace
#

yeah \o