See the code behind this demo!

Checkout setup card

Setup a card for future payments.

Collecting payment details using Checkout’s setup mode is useful for setting up a payment method on file for future payments.


Console

> Ready ...

                                      
  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',
  });
          
        

Experiment and learn

Make copies, remix, change and learn how to play with this tinydemo.


Any questions?

Reach out to us on any of our contact channels: