Subscriptions without the glue.

The billing-stripe add-in: checkout sessions, subscriptions with trials, and typed, verified, de-duplicated webhooks.

What you get

  • user.checkout(&stripe, CheckoutParams::subscription(…)) for hosted checkout.
  • Webhooks verified by signature and handled once across replicas.
  • A failed webhook is a WebhookFailed event with the provider’s event id.

In the docs

src/app/http/controllers/billing_controller.rs
pub async fn subscribe(user: AuthenticatedUser<User>) -> Result<Response> {
    let stripe = resolve::<Stripe>()?;

    let session = user
        .checkout(&stripe, CheckoutParams::subscription("price_pro", success, cancel).trial_days(14))
        .await?;

    Ok(Redirect::see_other(session.url.unwrap_or_default()))
}

Up close

Select an image to see it full size.

Checkout is one call on the user; the example runs it against a faked Stripe over the HTTP client, so it needs no account.
Webhooks are verified: the signed one is accepted, the forged one is a 400.
All features

Type to search 2.0.0 docs.