#nima_webhooks

1 messages ยท Page 1 of 1 (latest)

dusty glacierBOT
#

๐Ÿ‘‹ 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.

gusty pagodaBOT
shy crow
#

Hi, let me help you with this.

#

So the issue if you're not getting checkout.session.completed on your local webhook?

analog acorn
#

On the dashboard it says:
{
"error": "No webhook payload was provided."
}

shy crow
#

Could you please share the Event ID?

analog acorn
shy crow
#

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?

analog acorn
shy crow
#

No, the secret key used in your stripe.exe

gusty pagodaBOT
analog acorn
analog acorn
restive dove
#

no, you use stripe login to authenticate it with your account

analog acorn
# restive dove 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
  }
restive dove
#

yep so the next step is to debug the code and see why it's returning a 400

analog acorn
analog acorn
#

Wasn't getting it correctly out of the req. All good now