How cards work
Learn how an online credit or debit card payment works.
Cards are one of the most popular ways to pay online, with broad global reach. There are different types of cards and several steps in the process. To build a Stripe integration that supports all of your customers, see what goes on behind the scenes of a card payment.
Stripe checks that the details provided are formatted correctly (for example, the expiry date isn’t in the past). There’s no guarantee that the card itself is valid yet.
Some banks, especially in regulated regions like Europe and India, may prompt the customer to authenticate a purchase (for example, by texting the customer a code to enter on the bank’s website). Watch our video to learn more.
The bank checks for sufficient funds and, if successful, holds the amount on the customer’s account to guarantee it for the Stripe user.
The money moves from the issuing bank to the Stripe user’s account.
Card updates
Updating a saved card can only change its name, billing address, expiration date, or metadata. To make any other changes, you must delete the card and create a new one.
To let your customers manage their own payment methods, implement processes that allow them to manually update and replace their saved cards.
To change a customer’s default payment method for invoices and subscriptions, make an API call to update customer and provide a new value for the invoice_
property.
For information on how Checkout handles saved payment methods, see the create session API reference. To consider default payment methods in other scenarios, use custom code.
Automatic card updates
Saved payment method details can continue to work even if the issuing bank replaces the physical card. Stripe works with card networks and automatically attempts to update saved card details whenever a customer receives a new card (for example, replacing an expired card or one that was reported lost or stolen). This allows your customers to continue using your service without interruption and reduces the need for you to collect new card details whenever a card is replaced.
Automatic card updates require card issuers to participate with the network and provide this information. It’s widely supported in the United States, allowing Stripe to automatically update most American Express, Visa, Mastercard, and Discover cards issued there. International support varies from country to country. It isn’t possible to identify cards that support automatic updates.
You can listen for Stripe webhooks to learn of card update activity:
- The
payment_
event notifies you of updates to a card through an API call.method. updated - The
payment_
event notifies you of automatic card updates from the network.method. automatically_ updated
These events include the card’s new expiration date and last four digits, so you can update your own records as needed. If the card update includes a new card number, the fingerprint changes.