Giter Club home page Giter Club logo

paypal's Introduction

PayPal Checkout Demo img

This PayPal checkout demo project was bootstrapped with React. With the help of latest react hook api.

The CI/CD of this project has been taken care by Github Actions.

Live demo (Hosted in Firebase)

https://client-5c15a.web.app/client-implement

Payer Sandbox Acount for tesing

[email protected] pw: V?P99V>p

Build

In the project directory, you can run:

npm i

then:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

Structure

Client Implementation

This demo project includes two way to finish PayPal checkout flow, in the client Implementation, the Smart Payment Button takes care of the whole checkout flow. Two hook functions are implemented, one is creating order which will call order api to create a new transaction, once payer approved the transaction, the capture function will capture the fund, then notify payer the transaction is done. The page will redirect to complete page with transaction detail information. The smart button will handle funding failure automatically (ask user to select other approaches).

Server Implementation

In the Server Side Implementation, the frontend for user is basically same, but when payer click paypal button which is actually calling our node backend to create transaction, then the backend will use paypal checkout server SDK to create order, then return the orderId to client, once payer approved the order, the frontend will tell backend to call order capture, then there is another call in the backend to get transaction detail, which will be send back to client for user reference. Same like client side implementation, the page will automatically redirect to complete page then show detail information. If there is funding failure, the client will call actions.restart to restart the flow.

paypal's People

Contributors

stevenziu avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.