Git Product home page Git Product logo

paypal-checkout-demo's Introduction

PayPal Checkout Integration Patterns Demo WebApp

Description

The demo web application is a React app that shows different styles of PayPal integrations. It uses the wonderful Ace Code Editor to provide a live demonstration HTML and Javascript code which you can tweak and see rendered on the page.

Development

The source is found in the src/app directory.

Please feel free to follow the Contribution Guidelines to contribute to this demo application. PRs are welcome, but for major changes please raise an issue first.

Run locally in Docker

This command downloads all requirements, builds the source and starts the app inside the container. Nothing other than Docker needs to be installed.

$ docker-compose up

If you make code changes and want to see them reflected, you will need to rebuild the container with and start the updated container with the following commands

$ docker-compose build
$ docker-compose up

Run locally at command line

Download project requirements

$ npm install

Build the React app

$ npm run build

Start the app

$ node src/app/server

paypal-checkout-demo's People

Contributors

abarco avatar adamlcolson avatar briceshatzer avatar edbird-pp avatar eliotsykes avatar erikmhummel avatar gregjopa avatar mstuart avatar renovate-bot avatar vishakha94 avatar westeezy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paypal-checkout-demo's Issues

How to retrieve payment id on client side before transaction is executed?

Commented inside code.
I've attempted both .then() and even used the param from the function data and actions neither return a value. I'm assuming the call needs to be made AFTER the payment is created. But "how?" when the transaction is being created on a return script.

<script>
/*
    // Render the PayPal button

    paypal.Button.render({

        // Set your environment

        env: 'sandbox', // sandbox | production

        // Specify the style of the button

        style: {
            label: 'checkout',
            size:  'small',    // small | medium | large | responsive
            shape: 'pill',     // pill | rect
            color: 'gold'      // gold | blue | silver | black
        },

        // PayPal Client IDs - replace with your own
        // Create a PayPal app: https://developer.paypal.com/developer/applications/create

        client: {
            sandbox:    'AZDxjDScFpQtjWTOUtWKbyN_bDt4OgqaF4eYXlewfBP4-8aqX3PiV8e1GWU6liB2CUXlkA59kJXE7M6R',
            production: '<insert production client id>'
        },*/

        payment: function(data, actions) { 
            return actions.payment.create({ //<- specifically over here
                payment: {
                    transactions: [
                        {
                            amount: { total: '0.01', currency: 'USD' }
                        }
                    ]
                }
            }).then(function(payment){
                window.alert(payment.id);  // i desire the payment id. but it keeps returning undefined no matter what i do.
            });
        },
/*
        onAuthorize: function(data, actions) {
            return actions.payment.execute().then(function() {
                window.alert('Payment Complete!');
            });
        }

    }, '#paypal-button-container');
*/
</script>

Fix html validator errors with code snippets

I noticed the closing </html> tag is missing in one of the code snippets. There are probably other minor issues. Use the feedback from the w3c validator to ensure the code snippets are valid html.

For example, here's a screenshot of the validation errors for the client-side code snippet:
Screen Shot 2020-07-09 at 11 16 17 AM

Change to id from paymentID

we should have the server just respond with the entire payment object and change the client side to return res.id in the payment callbacks. I think it will cause less confusion.

image

The Demo does not appear to work here or on developer.paypal.com

This affects both this demo and the developer documentation examples in the PayPal Developer Portal.

Steps:

  • Follow demo links in the public docs at developer.paypal.com
    OR
  • clone project
  • replace clientIDs and secrets with working APP in sandbox
  • Update callbacks in client portion of demo
  • run via Docker per Readme
    ± |master ?:1 ✗| → docker-compose up Starting paypalcheckoutdemo_web_1 Attaching to paypalcheckoutdemo_web_1 web_1 | Server started at http://localhost:8002/demo/checkout

The Button never renders. Basically nothing happens. It did work a few weeks ago. There are no errors in the browser or on the demo server. The only output in the client is the following:

util.js:64 XHR failed loading: POST "https://www.sandbox.paypal.com/webapps/hermes/api/logger". 09:50:56.072 util.js:64 XHR finished loading: POST "https://www.paypal.com/webapps/hermes/api/logger".

screen shot 2017-06-13 at 11 09 34 am

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency lint-staged to v14
  • chore(deps): update dependency nodemon to v3
  • chore(deps): update dependency prettier to v3
  • chore(deps): update node.js to v20
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
dockerfile
Dockerfile
  • node 4.5
html
src/angular.htm
  • angular.js 1.8.0
src/react.htm
  • react 16.13.1
  • react-dom 16.13.1
  • babel-core 5.8.38
npm
package.json
  • belter ^1.0.92
  • body-parser ^1.17.1
  • cookie-parser ^1.4.3
  • react ^16
  • react-dom ^16
  • react-router ^5.0.0
  • react-router-dom ^5.2.0
  • request ^2.81.0
  • zalgo-promise ^1.0.38
  • @babel/core ^7.10.5
  • @babel/preset-env ^7.10.4
  • @babel/preset-react ^7.10.4
  • babel-loader ^8.1.0
  • concurrently ^7.6.0
  • eslint ^7.4.0
  • eslint-config-prettier ^6.11.0
  • eslint-plugin-prettier ^3.1.4
  • husky ^4.2.5
  • lint-staged ^10.2.11
  • nodemon ^2.0.20
  • prettier ^2.0.5
  • webpack ^4.43.0
  • webpack-cli ^3.3.12
  • webpack-dev-server ^3.11.0

  • Check this box to trigger a request for Renovate to run again on this repository

Add meta description tag to improve SEO

Add a meta description tag to help improve SEO. Bonus points for updating the <title> and <meta name="description" with client-side routing changes.

Here's a screenshot of how this app can look in google search results:
Screen Shot 2020-07-09 at 11 06 59 AM

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.