Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/derrmru/paypal-smart-button-react
- Owner: derrmru
- Created: 2021-04-20T13:23:55.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-07-30T16:04:28.000Z (over 3 years ago)
- Last Synced: 2024-04-24T04:31:09.395Z (7 months ago)
- Topics: paypal-button, react-paypal, reactjs
- Language: JavaScript
- Homepage: https://thepetersweeney.com/projects/paypal-react
- Size: 147 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
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!