Capture an Authorization
SDKLegacyLast updated: June 20th 2023, @ 6:44:12 pm
Note: This guide assumes you have completed a basic Smart Payment Buttons integration.
Complete these steps on the server:
This code:
- Sets up your server to make calls to PayPal.
- Gets the authorization ID from your database.
- Calls PayPal to capture the authorization.
- Saves the order ID to your database.
- Handles any errors from the call.
The capture request generates a response with a capture ID that you can use for refunding transactions:
For the full list of parameters and example responses, see capturing authorized payments in the Payments API reference.
Note: Remember to swap the credentials and API URL from sandbox to production when going live with your integration.
You can now call the PayPal Orders API to capture an authorization.