Using hosted pages
By default,billing.attach returns a paymentUrl — just redirect the customer and Autumn handles payment collection, confirmation, and activation.
successUrl (or the default URL in your Autumn dashboard).
Building your own checkout
For full control over the checkout experience, useredirectMode: "if_required". This charges the saved payment method directly instead of redirecting — the customer is only sent to Stripe Checkout if they don’t have a payment method yet.
Step 1: Preview the charge
Callbilling.previewAttach to get line items, totals, and proration details to display in your UI.
Step 2: Confirm and charge
Once the customer confirms, callbilling.attach with redirectMode: "if_required".
Handling the response
Thebilling.attach response has two key fields:
payment_url — a URL the customer should be redirected to, or null if no redirect is needed.
required_action — present when payment couldn’t be processed automatically. See Edge Cases for details on handling 3DS, payment failures, and retries.
