This sample app shows you how to integrate PayPal into your React app for the standard checkout workflow.
Follow the instructions below.
- Rename the
.env.examplefile to.env. - Inside of
the App.jsxfile, enter your PayPalclient-idinside theinitialOptionsobject. - Run npm install in your terminal
- Run npm start in your terminal (this will run the server separetly from the backend)
- Rename the
.env.examplefile to .env. - Inside of the
.envfile, enter your PayPal client ID for thePAYPAL_CLIENT_IDand your PayPal app secret for thePAYPAL_CLIENT_SECRETenviroment variables. - Run npm install in your terminal
- Run npm start in your terminal (this will run the server separetly from the frontend)
In the root folder, run npm start in your terminal. This will run the backend and frontend at the same time.
- Navigate in your browswer to
http://localhost:3000/ - I'm able to have my frontend and backend server similute they are in the same server port by adding
"proxy": "http://localhost:9597"to my frontendpackage.json.
Card Type: Visa
Card Number: 5458406954745076
Expiration Date: 01/2025
CVV: 123
The PayPal Developer community helps you build your career while improving your products and the developer experience. You’ll be able to contribute code and documentation, meet new people and learn from the open-source community.
- Website: developer.paypal.com
- Twitter: @paypaldev
- GitHub: @paypal
