mix pin_stripe.install (PinStripe v0.3.1)

View Source

Install PinStripe with Stripe webhook support

This installer will:

  1. Replace Plug.Parsers with PinStripe.ParsersWithRawBody in your Phoenix endpoint
  2. Generate a StripeWebhookController in lib/{app}_web with example event handlers
  3. Add a webhook route to your router that points to the generated controller
  4. Configure the webhook_paths in config/runtime.exs
  5. Add :pin_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 webhook path is configurable and supports multiple endpoints.

The generated controller automatically handles signature verification and dispatches events to handler functions you define using the handle DSL.

Example

mix pin_stripe.install --path /webhooks/stripe

Options

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