This folder contains example code for a PayPal advanced Checkout integration using both the JavaScript SDK and Node.js to complete transactions with the PayPal REST API.
v2
contains sample code for the current advanced Checkout integration. This includes guidance on using Card Fields.v1
contains sample code for the legacy advanced Checkout integration. Usev2
for new integrations.
These instructions apply to the sample code for both v2
and v1
:
- Rename
.env.example
to.env
and updatePAYPAL_CLIENT_ID
andPAYPAL_CLIENT_SECRET
. - Run
npm install
- Run
npm start
- Open http://localhost:8888
- Enter the credit card number provided from one of your sandbox accounts or generate a new credit card