This feature modifies an existing PayPal Checkout integration and uses the following:
- JavaScript SDK: Adds PayPal-supported payment methods.
- Orders REST API: Create, update, retrieve, authorize, and capture orders.
Last updated: May 6th, 9:27pm
Use this guide if your integration uses a single-page application to accept payments, built on a library or framework such as React, Vue, or Angular.
This feature modifies an existing PayPal Checkout integration and uses the following:
PayPal uses the following REST API credentials, which you can get from the developer dashboard:
You can use Postman to explore and test PayPal APIs. Learn more in our Postman guide.
The JavaScript SDK shows your payer's available payment methods on your checkout page.
Set up the PayPal checkout for your application by using the JavaScript SDK and handling the payer's interactions with the PayPal checkout button. Place the following script
tag in your index.html
page based on how you plan to render payment buttons, so the paypal
object is available when you need it in the checkout flow. You can render the payment buttons either immediately, or after user action, navigation, or other page change:
1<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID">2</script>
1<script defer src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID">2</script>
Note: This sample code is optimized for JavaScript performance. To learn more about how to optimize the JavaScript SDK, see JavaScript SDK performance optimization.
Copy the sample request and modify it as follows:
YOUR_CLIENT_ID
with your client ID.USD
for currency
. To learn more about the default values, see the JavaScript SDK script configuration.