This repository contains sample integrations for PayPal's v6 Web SDK. Learn how to:
- make one-time payments with different payment methods like PayPal and Venmo
- save payments methods for future transactions (coming soon)
- add Pay Later messaging (coming soon)
-
Setup a PayPal Account
To get started, you'll need a developer, personal, or business account.
You'll then need to visit the Developer Dashboard to obtain credentials and to make sandbox accounts.
-
Create an Application
Once you've setup a PayPal account, create a sandbox application to obtain a Client ID and Secret.
- Clone the repository by running the following command in your terminal:
git clone https://github.com/paypal-examples/v6-web-sdk-sample-integration.git
- Create a
.env
file based on the.env.sample
file at the root of this repository:cd v6-web-sdk-sample-integration cp .env.sample .env
- Open the
.env
file in a text editor and add values for thePAYPAL_SANDBOX_CLIENT_ID
andPAYPAL_SANDBOX_CLIENT_SECRET
environment variables. - To run the server, choose a server implementation from the
server
folder at the root of this repository and follow the instructions in that folder's README. For example, for Node.js run:cd server/node npm install npm start
- To view the sample integration in your browser, choose a front-end implementation from the
client
folder at the root of this repository and follow the instructions in that folder's README. For example, for the one-time payments html example run:cd client/one-time-payment/html npm install npm start