paypal button for react.js

后端 未结 2 1603
北海茫月
北海茫月 2020-12-10 21:21

so I\'m trying to get the paypal button to show up on my app but I can\'t get it work. I\'m basing it off this jsfiddle. https://jsfiddle.net/rbacekkb/

I tried to p

相关标签:
2条回答
  • 2020-12-10 21:49

    Seems that nobody has yet developed a react's paypal button until today (for react-native, there may be one, but my library is the first), that's why I have just created one for everybody!

    ==========

    For everyone's reference, if you want to use Paypal's express checkout button (simply passing the total amount to be paid)

    Please use react-paypal-express-checkout (I'm the author):

    Install:

    npm install --save react-paypal-express-checkout
    

    Simplest Example (but it will show the Paypal express check out button):

    import React from 'react';
    import PaypalExpressBtn from 'react-paypal-express-checkout';
    
    export default class MyApp extends React.Component {
        render() {
            const client = {
                sandbox:    'YOUR-SANDBOX-APP-ID',
                production: 'YOUR-PRODUCTION-APP-ID',
            }   
            return (
                <PaypalExpressBtn client={client} currency={'USD'} total={1.00} />
            );
        }
    } 
    

    ==========

    For more detailed document, please go here:

    https://github.com/thinhvo0108/react-paypal-express-checkout

    This library was developed for reactjs, written in ES6, simple but yet workable, please check my tutorials for both simplest and full examples

    This library provides the Paypal's express check out button (which means we can now just pass in the total amount to be paid)

    Later, more advanced features will come! Fork & pull-request are welcomed, and please also give me credit if you use or find it interesting!

    0 讨论(0)
  • 2020-12-10 21:55

    PayPal actually exposes a React button:

    https://github.com/paypal/paypal-checkout/blob/master/docs/frameworks.md https://github.com/paypal/paypal-checkout/blob/master/demo/react.htm

    0 讨论(0)
提交回复
热议问题