Skip to content

paypaldev/PayPal-React-Donate-Sample

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

PayPal Developer Cover

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

PayPal-React-Donate-Sample

Table of Contents
  1. Installation
  2. Usage
  3. License

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

  1. Clone the repo

    git clone https://github.com/paypaldev/PayPal-React-Donate-Sample.git
  2. Install dependencies

    yarn

    or

    yarn install
  3. Start a local development server

    yarn run dev

(back to top)

Usage

PayPal donation form

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.

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

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.

About

PayPal donations sample app using React components for the PayPal JS SDK

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published