PayPal-React-Donate-Sample
Table of Contents
This sample app shows how to add PayPal donations to your React application using the react-paypal-js npm package.
Sample code to render donation buttons can be found in the react-paypal-js
GitHub repository and the interactive documentation site.
Installation
-
Clone the repo
git clone https://github.com/paypaldev/PayPal-React-Donate-Sample.git
-
Install dependencies
yarn
or
yarn install
-
Start a local development server
yarn run dev
Usage
In this example, we are building a donation form for Kitty's House, a fictional cat rescue organization. The form allows the donor to choose from three donation amounts or enter a custom donation amount.
Once a donation button is clicked, the user will follow the standard checkout flow from the PayPal JavaScript SDK.
On approval, for demonstration purposes, the app will alert with a message that the donation was completed.
To fully test the donation flow, you'll need to have access to sandbox account credentials. If you have a PayPal developer account personal and business sandbox accounts were created when your registered.
See our developer site to learn how to set up a sandbox account.
License
Distributed under the MIT License. See LICENSE
for more information.
PayPal Developer Community
The PayPal Developer community helps you build your career, while also improving PayPal 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