Saving cards using MOTOBêta
Save mail order and telephone order (MOTO) card details for reuse.
MOTO SetupIntents allow you to enter the card information on the reader and save the payment details without charging the card.
To do this with a server-driven integration, you must:
- Create or retrieve a Customer.
- Create a SetupIntent.
- Process the SetupIntent.
- Verify the reader state.
- Use the PaymentMethod.
![MOTO saving card screenshots](https://b.stripecdn.com/docs-statics-srv/assets/moto-save-card-light.e745c8d7833fd8290aa7827c57139c6a.png)
Saving a card with MOTO flow
Create or retrieve a Customer![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
To charge a card saved with Stripe, you must attach it to a Customer.
When you include a customer in your SetupIntent before confirming, Stripe automatically attaches the generated card payment method to the provided Customer object that you create/retrieve.
Include the following code on your server to create a new Customer
:
Create a SetupIntent![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
A SetupIntent is an object that represents your intent to set up a customer’s payment method for future payments. The SetupIntent tracks the steps of this setup process. The payment_method_types must include card
.
Process the SetupIntent![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
After you create the SetupIntent, use process_setup_intent to process the payment, setting process_config[moto] to true
. If the customer provides the required form of agreement or consent, set the customer_
Boolean to true.
The process_setup_intent request is asynchronous. After the request, the reader prompts you to enter the cardholder’s card number, CVC, expiration date, and postal code. You can then confirm the cardholder’s details to submit the card details for authorization.
Verify the reader state![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
Your application must follow the instructions for verifying the reader state to confirm a successful (approved) SetupIntent.
Use the PaymentMethod![](https://b.stripecdn.com/docs-statics-srv/assets/fcc3a1c24df6fcffface6110ca4963de.svg)
You can now charge the saved PaymentMethod associated with the Customer
using a PaymentIntent.
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.