#nima_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ 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.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ 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/1232997140268322867
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
So the issue if you're not getting checkout.session.completed on your local webhook?
The local webhook does not show anything from my application itself. But on the stripe dashboard it says that it is "pending webhook".
On the dashboard it says:
{
"error": "No webhook payload was provided."
}
Could you please share the Event ID?
evt_1P9P5fLJsnsdQ4qHAvZviZPW
Ok, we attempted to send this event to your webhook endpoint (not a local one), and your server responded with a 400 error
Are you sure your local instance uses a secret key from the same account you see on the Dashboard?
The whsec key, right? I copied it from the terminal ye.
No, the secret key used in your stripe.exe
uhhh
Am i suppost to set a key for the stripe.exe?
no, you use stripe login to authenticate it with your account
๐คฆโโ๏ธ
I see...
Now it shows in the terminal. Although i get 400 status.
let data, eventType
if (env.STRIPE_WEBHOOK_SECRET) {
let event
try {
event = stripe.webhooks.constructEvent(request.rawBody, request.headers['stripe-signature'], env.STRIPE_WEBHOOK_SECRET)
} catch (err) {
console.log(`โ ๏ธ Webhook signature verification failed.`)
return new Response(JSON.stringify({ error: err.message }), {
status: 400,
headers: { 'Content-Type': 'application/json' }
})
}
data = event.data
eventType = event.type
}
yep so the next step is to debug the code and see why it's returning a 400
Thanks for the help.
I'll do so ๐
Wasn't getting it correctly out of the req. All good now