UNPKG

@vbusatta/adonis-stripe

Version:

Provider for AdonisJS 6. Simplifies Stripe integration with webhooks and services.

18 lines (17 loc) 710 B
/** * Middleware to validate and handle incoming Stripe webhook events. * * This middleware verifies the signature of the webhook request to ensure * that it comes from Stripe. If the signature is valid, the event is attached * to the context and processed by the appropriate handler in the `StripeService`. * * @see https://stripe.com/docs/webhooks */ import type { HttpContext } from '@adonisjs/core/http'; import type { NextFn } from '@adonisjs/core/types/http'; import StripeService from './stripe.js'; export default class InitializeStripeWebhookMiddleware { protected stripe: StripeService; constructor(stripe: StripeService); handle(ctx: HttpContext, next: NextFn): Promise<void>; }