mix tiny_elixir_stripe.install (TinyElixirStripe v0.1.13)

View Source

Install TinyElixirStripe with Stripe webhook support

This installer will:

  1. Replace Plug.Parsers with TinyElixirStripe.ParsersWithRawBody in your Phoenix endpoint
  2. Create a stub WebhookHandler module in lib/{app} for defining event handlers
  3. Generate a StripeWebhookController in lib/{app}_web that uses TinyElixirStripe.WebhookController
  4. Add a webhook route to your router that points to the generated controller
  5. Add :tiny_elixir_stripe to import_deps in .formatter.exs for DSL formatting support

The ParsersWithRawBody plug caches the raw request body for webhook signature verification, as required by Stripe's webhook security.

The generated controller automatically handles signature verification and forwards events to your WebhookHandler module.

Example

mix tiny_elixir_stripe.install --path /webhooks/stripe

Options

  • --path or -p - The webhook endpoint path (default: "/webhooks/stripe")