Skip to content

LucasSaud/PayPal-React-Subscription-Sample

 
 

Repository files navigation

PayPal Developer Cover

Twitter: PayPal Developer
Twitter   -   PayPal   -   Docs   -   Code Samples   -   Blog

PayPal React (NodeJS) Fullstack Subscription

This sample app shows how to integrate PayPal into your React app to add subscription payments.

Run this project

PayPal Codespaces

Open Code In GitHub Codespaces

  • Rename the .env.example file to .env.
  • Add your environment variables in the .env file.

Locally

Follow the instructions below.

First, install the frontend and backend dependencies with npm install.

Config Frontend

  • Inside the client/App.jsx file, enter your PayPal client-id inside the initialOptions object.

Config Backend

  • Rename the .env.example file to .env.
  • Inside the .env file, enter your PayPal client ID for the PAYPAL_CLIENT_ID, your subscription plan id for the PLAN_ID, and your PayPal app secret for the PAYPAL_CLIENT_SECRET environment variables.

Run app

In the root folder, run npm start in your terminal. This will run the backend and frontend at the same time.

  • Navigate in your browser to http://localhost:3000/

Sample Card

Card Type: Visa

Card Number: 5458406954745076

Expiration Date: 01/2025

CVV: 123

PayPal Developer Community

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.

About

React + NodeJS app using PayPal to hander subscriptions on your web application.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 84.0%
  • Shell 11.8%
  • HTML 4.2%