PayPal Standard Checkout with Alternative Payment Methods
This repo contains example code for a standard PayPal integration using both the JS SDK and node.js to complete transactions with the PayPal REST API.
Instructions
- Create an application
- Rename
.env.example
to.env
and updateCLIENT_ID
andAPP_SECRET
- Replace
test
inpublic/index.html
with your app's client-id - Run
npm install
- Run
npm start
- Open http://localhost:8888
- Click "PayPal" and log in with one of your Sandbox test accounts
Demo
The GIF below shows a user interface for checkout with four payment options and a corresponding payment button for each option upon selection. The choices are pay with PayPal, debit/credit card, Pay Later, and (fictional) Monkey Cash for an example of a PayPal alternative payment method.