Collecting payment details using Checkout’s setup mode is useful for setting up a payment method on file for future payments.
const customer = await stripe.customers.create({
name: 'Jenny Rosen',
email: 'jenny@example.com'
});
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
mode: 'setup',
customer: customer.id,
success_url: 'https://stripe-tinydemos-checkout-setup-card.glitch.me?success=true',
cancel_url: 'https://stripe-tinydemos-checkout-setup-card.glitch.me?cancel=true',
});
Make copies, remix, change and learn how to play with this tinydemo.
Reach out to us on any of our contact channels: