PayPal
Use PayPal to take payments in your app with PayPal checkout. To connect, you need the client ID and secret of a REST app on PayPal’s developer site. Start with a Sandbox app, which takes test payments.
Connect PayPal
On PayPal’s developer site, open Apps & Credentials, and then copy the client ID and secret of an app on the Sandbox tab. FlutterFlow detects whether they belong to a Sandbox app or a Live app.
Only a project owner can connect PayPal. If you’re a project owner, connect PayPal:
- Open Project Settings › Connections, and then turn on the switch for PayPal.
- In the Connect PayPal dialog, paste the client ID into Client ID and the secret into Client secret. Find it opens PayPal’s developer site.
- Click Connect.
See Connect a service.
What to ask
With PayPal connected, your app can start a checkout, send the customer to PayPal to approve the payment, capture the payment when PayPal sends them back, and read an order back. Nothing is charged until your app captures the payment. Ask for the checkout you want, and say what the customer pays for.
Add a Pay with PayPal button to the booking screen that charges the visit’s price in USD. After the customer approves on PayPal, capture the payment and mark the booking paid only if the capture completed for the right amount.
Add PayPal checkout to the cart. When PayPal sends the customer back, capture the order and show a receipt, and if they cancel on PayPal, return them to the cart.
Read the PayPal order whose ID I provide, and tell me its status, the amount and currency, and whether the payment was captured.
Agent questions
If PayPal isn’t connected, the agent asks you to connect it in a card above the message box. See Connect when the agent asks.
If your PayPal connection is a live account, the agent asks an owner of the app to approve each PayPal call in a thread that owner started. See Live payments.
Review
After the agent finishes, read the turn’s Summary and review its Changes. Check the affected screens in Screens, and try the change in Preview. If the change uses records or sign-in, test it with the thread’s own data in Data.
After you push a backend change, check the result in Backend.
A PayPal payment counts as paid only when its capture status is COMPLETED. A capture that’s pending, declined, or failed isn’t paid. Before your app treats an order as paid, check that the app reads the order back and compares the amount, the currency, and its own order reference with the order that it priced.
In the preview, PayPal’s page opens, but the buyer comes back to your app’s return page, not the preview. Try the whole payment on a phone build.
Push
When the checkout works, push the changes to your app.
Live payments
To take real payments, use a Live app. To switch, replace the Sandbox credentials with the Live app’s. If you’re a project owner, click PayPal’s menu in Project Settings › Connections, and then select Replace client secret.
A live connection shows Live account. Your preview and the agent take real payments with it, so use a Sandbox app while you build.
On a live account, every PayPal call that the agent makes in a thread that an owner of the app started waits on an Approval card, including calls that only read an order. That owner approves, and each approval runs one call. In a thread that anyone else started, the agent can’t use a live PayPal account. See Live payment accounts.
Chat connections
Account › Chat connections also lists PayPal. That connection is separate: it’s your own PayPal account, which the agent uses in threads that you start, and your app doesn’t use it. See Tools for the agent.
Next steps
- To replace the credentials or disconnect PayPal, see Manage connections.
- For other services your app can use, see Available services.
Troubleshooting
If PayPal refuses the client ID and secret, copy both again from the same app under Apps & Credentials, on the Sandbox or Live tab. If your app can’t capture or read an order, check that the order came from the same connection: a Sandbox connection can’t read a Live order. For other connection problems, see Troubleshoot connections.