Set up future PayPal payments
Learn how to save PayPal details and charge your customers later.
Set up future PayPal payments to save customer payment details for subscriptions, delayed charges, and streamlined future purchases. Learn how to enable and use recurring payments with PayPal through Stripe.
Enable recurring payments 
Stripe automatically enables recurring payments for most users when they activate PayPal payments in the Stripe Dashboard. However, due to PayPal’s policies and regional restrictions, some users might need to enable recurring payments manually. This includes users that set up their accounts before we introduced automatic enablement. To manually enable recurring payments:
Go to your Payment methods settings.
Click PayPal > Enable in the Recurring payments section.
After you enable recurring payments, it appears as pending in the Dashboard. It usually takes up to five business days to get access.
When you’re granted access, recurring payments are available in your PayPal settings. In testing environments, recurring payments are enabled by default.
You can use Setup Intents to collect PayPal payment method details in advance, and determine the final amount or payment date later. Use it to:
Create or retrieve a CustomerServer-side
To reuse a PayPal payment method for future payments, you must attach it to a Customer.
Create a Customer object when your customer creates an account on your business. Associating the ID of the Customer object with your own internal representation of a customer enables you to retrieve and use the stored payment method details later. If your customer hasn’t created an account, you can still create a Customer object now and associate it with your internal representation of the customer’s account later.
Create a SetupIntentServer-side
A SetupIntent is an object that represents your intent and tracks the steps to set up your customer’s payment method for future payments.
Create a SetupIntent on your server with payment_method_types set to paypal
and specify the Customer’s id.
The SetupIntent object contains a client_secret, a unique key that you need to pass to Stripe on the client side to redirect your buyer to PayPal and authorize the mandate.
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 PayPal. Afterwards, the completion block is called with the result of the payment.
Monitor webhooksServer-side
Use a method such as webhooks to confirm the billing agreement was authorized successfully by your customer, instead of relying on your customer to return to the payment status page. When a customer successfully authorizes the billing agreement, the SetupIntent emits the setup_intent.succeeded webhook event. If a customer doesn’t successfully authorize the billing agreement, the SetupIntent will emit the setup_intent.setup_failed webhook event and returns to a status of requires_
. When a customer revokes the billing agreement from their PayPal account, the mandate.updated is emitted.
Charge off-session payments with a saved PayPal payment methodServer-side
When you’re ready to charge your customer off-session, use the Customer and PaymentMethod IDs to create a PaymentIntent.
To find a paypal
instrument to charge, list the PaymentMethods associated with your Customer.
When you have the Customer and PaymentMethod IDs, create a PaymentIntent with the amount and currency of the payment. Set a few other parameters to make the off-session payment:
- Set off_session to
true
to indicate that the customer is not in your checkout flow during this payment attempt. This causes the PaymentIntent to throw an error if authentication is required. - Set the value of the PaymentIntent’s confirm property to
true
, which causes confirmation to occur immediately when the PaymentIntent is created. - Set payment_method to the ID of the PaymentMethod and customer to the ID of the Customer.
User-initiated payment method cancellationServer-side
A customer can cancel the subscription (Billing Agreement) through their PayPal account. When they do so, Stripe emits a mandate.updated webhook. All subsequent Payment Intents using the saved Payment Method will fail until you change to a Payment Method with active mandates. When payments fail for Subscriptions, the status changes to the Subscription status configured in your automatic collection settings. Notify the customer of failure and charge them with a different payment method.