Checkout and card data Required
Save cards with consent and charge renewals off-session
To charge a card later, save it at the first payment with SCA and the customer's consent. Mark each later charge as merchant-initiated.
How to do it
Charges you start without the customer present, such as renewals, are merchant-initiated transactions. They fall outside SCA when the first payment set up the agreement with SCA. Tell the provider at setup that the card is for future use, such as setup_future_usage: "off_session" at Stripe. Show the terms beside the pay button, such as "Example Bakery charges 129.50 SEK every month until you cancel". Mark each later charge as off-session. If the bank still asks for authentication, email the customer a link to finish it.
Example
await stripe.paymentIntents.create({
amount: 12950,
currency: 'sek',
customer: customerId,
payment_method: savedPaymentMethodId,
off_session: true,
confirm: true,
}, { idempotencyKey: `renewal-${subscriptionId}-${periodStart}` })
stripe.PaymentIntent.create(
amount=12950,
currency="sek",
customer=customer_id,
payment_method=saved_payment_method_id,
off_session=True,
confirm=True,
idempotency_key=f"renewal-{subscription_id}-{period_start}",
)
How to check
On staging, start a subscription with a card that needs authentication unless it was set up, such as Stripe's 4000 0025 0000 3155. The first payment shows a challenge. The renewal a month later, run with the provider's test clock, succeeds without one.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers payments playbook: https://agentwranglers.se/playbook/payments/checkout-and-card-data/off-session-payments.