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
With the iOS, Android, and React Native SDKs, you can create a PaymentIntent client-side and provide customer
and set setup_
.
Note
Client-side PaymentIntent
creation is possible with the other client SDKs. If you’re using the JavaScript SDK for Stripe Terminal, create a PaymentIntent
server-side.
Server-side
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.