Map of event types to their handlers. Each handler receives the event narrowed to its specific type.
const handlers: WebhookHandlers = { 'payment_intent.succeeded': (event) => { // event.data.object is a Stripe.PaymentIntent here console.log(event.data.object.amount); },}; Copy
const handlers: WebhookHandlers = { 'payment_intent.succeeded': (event) => { // event.data.object is a Stripe.PaymentIntent here console.log(event.data.object.amount); },};
Map of event types to their handlers. Each handler receives the event narrowed to its specific type.