Save card details after payment
Take an in-person payment and save card details to use later, when the cardholder is not physically present.
You can’t reuse the card_
PaymentMethod from an in-person transaction, but in most cases you can create a reusable generated_
PaymentMethod that represents the same card. From your customer’s perspective, they’re the same payment method.
Request a generated_
when you create a PaymentIntent by specifying a value for setup_future_usage. If the card supports being saved for future payments, successfully processing or confirming the payment returns the generated_
ID. If the PaymentIntent has an associated Customer, the generated_
automatically attaches to that Customer. If not, then you can manually attach it to a Customer later.
When you request a generated_
, always verify that the PaymentIntent.latest_charge contains a generated_card. In some cases, such as when using certain cards stored in digital wallets, a successful payment doesn’t create a generated_
. If that happens, and you require a generated_
, you have two options:
- Prompt the cardholder to save a different card using the flow to save a card without taking a payment.
- Refund the in-person payment, indicate that the transaction failed, and instruct the cardholder to use a different card.
The initial, in-person payment benefits from liability shift and, in certain markets, lower pricing for standard Terminal payments. However, subsequent payments using the generated_
are card-not-present online transactions. For example:
- A gym customer pays in person for an initial session and a membership subscription. The transaction sets up a
generated_
to use for future automatic membership renewals.card - A customer at a clothing store provides their email address when making a purchase at the checkout counter. The transaction creates a customer record and an associated
generated_
. That allows the customer to log into the store’s website later and place an order using the same card.card
Note
For most businesses, when you process a digital wallet payment such as Apple Pay or Google Pay, you can’t create a generated_
or otherwise save the payment method for reuse. For car rental services and hotels, Stripe offers a limited private beta feature that allows you to save a digital wallet payment method for reuse. To request access, contact stripe-terminal-betas@stripe.com.
Client-side![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
With the iOS, Android, and React Native SDKs, you can create a PaymentIntent client-side and provide the customer
and set setup_
.
Note
Client-side PaymentIntent
creation is possible with the iOS or Android SDKs. If you’re using the JavaScript SDK for Stripe Terminal, create a PaymentIntent
server-side.
Server-side![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
The JavaScript SDK and server-driven integration require you to create the PaymentIntent on your server. For iOS or Android, you can create the PaymentIntent on your server if the information required to start a payment isn’t readily available in your app.
You can retrieve the saved card details by listing the card payment methods associated with that customer.
Compliance![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
You’re responsible for your compliance with all applicable laws, regulations, and network rules when saving a customer’s payment details. For example, the European Data Protection Board has issued guidance regarding saving payment details. These requirements generally apply if you want to save your customer’s payment method for future use, such as presenting a customer’s payment method to them in the checkout flow for a future purchase or charging them when they’re not actively using your website or app.
Add terms to your website or app that state how you plan to save payment method details and allow customers to opt in. If you plan to charge the customer while they’re offline, then at a minimum, make sure that your terms also cover the following:
- The customer’s agreement to your initiating a payment or a series of payments on their behalf for specified transactions.
- The anticipated timing and frequency of payments (for instance, whether charges are for scheduled installment or subscription payments, or for unscheduled top-ups).
- How the payment amount is determined.
- Your cancellation policy, if you’re setting up the payment method for a subscription service.
Make sure you keep a record of your customer’s written agreement to these terms.
When you save a payment method, it can only be used for the specific usage that you included in your terms. If you want to charge customers when they’re offline and also save the customer’s payment method to present to them as a saved payment method for future purchases, you must explicitly collect consent from the customer. One way to do so is with a “Save my payment method for future use” checkbox.