Set up future Cash App Pay payments
Learn how to save Cash App Pay details and charge your customers later.
You can use the Setup Intents API to collect payment method details in advance, and determine the final amount or payment date later. Use it to:
- Save payment methods to a wallet to streamline future purchases
- Collect surcharges after fulfilling a service
- Start a free trial for a subscription
This guide covers how to first save payment method details using the Setup Intents API, and how to use the Payment Intents API to charge the saved payment method later.
Set up StripeServer-sideClient-side
First, you need a Stripe account. Register now.
Server-side 
This integration requires endpoints on your server that talk to the Stripe API. Use the official libraries for access to the Stripe API from your server:
Client-side 
The Stripe iOS SDK is open source, fully documented, and compatible with apps supporting iOS 13 or above.
Notiz
For details on the latest SDK release and past versions, see the Releases page on GitHub. To receive notifications when a new release is published, watch releases for the repository.
Configure the SDK with your Stripe publishable key on app start. This enables your app to make requests to the Stripe API.
Create or retrieve a CustomerServer-side
To save a Cash App Pay payment method for future payments, you must attach it to a Customer.
Create a Customer object when your customer creates an account with your business. Associate the ID of the Customer object with your own internal representation of a customer. Alternatively, you can create the Customer object before you save a payment method for future payments.
Include the following code on your server to create a new Customer.
Create a SetupIntentServer-side
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 set-up process. Create a SetupIntent on your server with payment_method_types set to cashapp
and specify the Customer’s ID and usage=off_session or usage=on_
.
Present authorization terms on your payment formClient-side
Save your customer’s Cash App Pay credentials($Cashtag) to charge their account for future, off-session payments. Your custom payment form must present a written notice of authorization before confirming the PaymentIntent or SetupIntent.
The authorization terms only need to be displayed the first time you save a customer’s $Cashtag.
We recommend that you use the following text for your custom payment form:
By continuing, you authorize Rocket Rides to debit your Cash App account for this payment and future payments in accordance with Rocket Rides's terms, until this authorization is revoked. You can change this anytime in your Cash App Settings.
Submit the payment to StripeClient-side
Retrieve the client secret from the SetupIntent you created and call STPPaymentHandler confirmSetupIntent. This presents a webview where the customer can complete the payment in Cash App. Afterwards, the completion block is called with the result of the payment.
Create a PaymentIntent using a saved payment methodServer-side
After you create a PaymentMethod, you can accept future Cash App Pay payments by creating and confirming a PaymentIntent. When confirming a PaymentIntent, use the same payment method ID from the previous SetupIntent or PaymentIntent object. The off_
value must also be set to true if the customer isn’t in a checkout flow for this PaymentIntent.
Handle reusable payment method revocation 
There are two ways to revoke a reusable payment method:
- A customer can deactivate a reusable payment method in the Cash App mobile application. In this case, Stripe sends a mandate.updated event. Subscribe to webhook events, and call detach PaymentMethod to deactivate it.
- A customer can also deactivate a reusable payment method on your UI, if supported. In this case, your server can call detach PaymentMethod to deactivate it.
In both cases, after you call the detach PaymentMethod, a payment_method.detached event is sent to you.