This sample is out of date, please see our Accept a Card Payment to learn how to build the same type of integration on the Payment Intents API.
The Charges API is an earlier Stripe payments API that does not handle bank requests for authentication (e.g. 3D Secure) that are becoming increasingly common online, especially in regions like Europe and India. The Payment Intents API helps you manage these more complex card flows in a future-proof, scalable integration that will work with other payment methods.