mix pin_stripe.install (PinStripe v0.3.1)
View SourceInstall PinStripe with Stripe webhook support
This installer will:
- Replace Plug.Parsers with PinStripe.ParsersWithRawBody in your Phoenix endpoint
- Generate a StripeWebhookController in lib/{app}_web with example event handlers
- Add a webhook route to your router that points to the generated controller
- Configure the webhook_paths in config/runtime.exs
- 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
--pathor-p- The webhook endpoint path (default: "/webhooks/stripe")