Skip to content

21m57/saving-card-without-payment

 
 

Repository files navigation

Saving cards without payment sample

This sample shows how to build a form to save a credit card without taking a payment using the Setup Intents API. This sample is a fully working version of this guide.

Demo

See a hosted version of the sample in test mode or fork on codesandbox.io

The hosted demo is running in test mode -- use 4242424242424242 as a test card number with any CVC + future expiration date.

Use the 4000000000003220 test card number to trigger a 3D Secure challenge flow.

Read more about test cards on Stripe at https://stripe.com/docs/testing.

Credit card details page

How to run locally

This sample implementation includes 5 servers in Node, Ruby, Python, Java, and PHP in the /server directory. We included several RESTful server implementations, each with the same endpoints and logic. Pick the language you are most comfortable in and follow the instructions in the directory on how to run.

If you want to run the sample locally, copy the .env.example file to your own .env file in this directory and follow the instructions in the specific server implementation you want to run.

cp .env.example .env

You will need a Stripe account with its own set of API keys.

Supported languages

FAQ

Q: Why did you pick these frameworks?

A: We chose the most minimal framework to convey the key Stripe calls and concepts you need to understand. These demos are meant as an educational tool that helps you roadmap how to integrate Stripe within your own system independent of the framework.

Q: Can you show me how to build X?

A: We are always looking for new recipe ideas, please email dev-samples@stripe.com with your suggestion!

Author(s)

@ctrudeau-stripe

About

How to build a form to save a credit card without taking a payment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 31.4%
  • JavaScript 19.3%
  • PHP 11.8%
  • Java 10.9%
  • Python 9.9%
  • Ruby 8.7%
  • HTML 8.0%