Skip to content

Stripe webhook signature verification #2518

Discussion options

You must be logged in to vote

Thanks! I managed to get it working like this in Hono:

export const stripeHandler = async (c: Context) => { 
  const sig = c.req.header('stripe-signature')
  const body = await c.req.raw.arrayBuffer()

  const event = stripe.webhooks.constructEvent(Buffer.from(body), sig, endpointSecret)
  // ...
}

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@fredrik-sogaard
Comment options

@hideokamoto-stripe
Comment options

@fredrik-sogaard
Comment options

Answer selected by fredrik-sogaard
Comment options

You must be logged in to vote
2 replies
@yusukebe
Comment options

@hideokamoto-stripe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants