6

I am quite new to reacjs and stuggle to create a reactjs component for paypal's in-context express checkout windows - it is simple to do in plain javascript but not sure how I can create a component and use it in similar way as react-stripe-checkout? thanks

2
  • I had the same issue setting up Paypal in my React application. Stripe can be a great alternative when accepting payments with credit card. I'm the author of the article, but it is a step by step guide to set it up. Commented Sep 28, 2017 at 14:03
  • Otherwise, checkout this step-by-step guide to integrate PayPal in a React component by using PayPal's REST API. Commented Feb 6, 2018 at 20:22

1 Answer 1

0

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} />
        );
    }
} 

==========

There is also a full example, in which you can have all types of callback function (e.g. completed payment-ID, return-URL etc.)

For full detailed document (as well as official guides from Paypal,) please go here:

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.