Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/derrmru/paypal-smart-button-react

A simple and straightforward react component to render a paypal smart button
https://github.com/derrmru/paypal-smart-button-react

paypal-button react-paypal reactjs

Last synced: 3 days ago
JSON representation

A simple and straightforward react component to render a paypal smart button

Awesome Lists containing this project

README

        

# Paypal Smart Button

Sometimes you just want a react component to be simple and work straight away. No Config and only a handful of required props.

This is a PayPal smart button that just works.

## Setup

1. The Hard Bit - if you have not already done so, follow [PayPal's instructions](https://developer.paypal.com/docs/checkout/integrate/?_ga=2.152185595.332577341.1618841693-1038715808.1617958209) to get your Client ID

2. In your CLI and once navigated to your React JS project, install with the following command:

```javascript
npm i react-paypal-smart-button
```

3. Implement in your app, as per the following example:

```javascript
import PayPalButton from 'react-paypal-smart-button'

function App() {
return (
handlePaypalSuccess()}
/>
);
}

export default App;
```

The props are of the following types:

```
price: number,
description: string,
clientId: string,
currency: string || this is a three digit currency code e.g. 'EUR', 'GBP' or 'USD'
paySubmit: function || this function will be called following successful payment transaction in your application. Handle the successful transaction however you like.
```

## Dependencies

None, just use it in your react project.

## Support My Work

If you find this component useful or like my work, why not buy me a coffee! - [Click Here](https://www.buymeacoffee.com/derrmru)

## That's it!