https://github.com/iamraphson/react-ravepayment
ReactJS library for implementing RavePay payment gateway
https://github.com/iamraphson/react-ravepayment
javascript payment payment-integration ravepay reactjs
Last synced: about 1 year ago
JSON representation
ReactJS library for implementing RavePay payment gateway
- Host: GitHub
- URL: https://github.com/iamraphson/react-ravepayment
- Owner: iamraphson
- License: mit
- Created: 2017-09-01T18:25:20.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-24T12:51:46.000Z (almost 6 years ago)
- Last Synced: 2025-02-27T05:55:56.721Z (over 1 year ago)
- Topics: javascript, payment, payment-integration, ravepay, reactjs
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/react-ravepayment
- Size: 2.96 MB
- Stars: 38
- Watchers: 5
- Forks: 24
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# react-ravepayment
A React library wrapper for implementing ReavePay Payment Gateway
## Demo

### Installation
```bash
npm install react-ravepayment --save
```
or
```bash
yarn add react-ravepayment --save
```
### Usage
### Hooks
```js
import React, { Component } from "react";
import { useRavePayment } from "react-ravepayment";
const config = {
txref: "rave-123456",
customer_email: "user@example.com",
customer_phone: "234099940409",
amount: 2000,
PBFPubKey: "FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXX-X",
production: false,
};
const App = () => {
const { initializePayment } = useRavePayment(config);
return (
initializePayment()}>Pay 2000
);
};
export default App;
```
### Components
```js
import React, { Component } from "react";
import { RaveProvider, RavePaymentButton } from "react-ravepayment";
const config = {
txref: "rave-123456",
customer_email: "user@example.com",
customer_phone: "234099940409",
amount: 2000,
PBFPubKey: "FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXX-X",
production: false,
onSuccess: () => {},
onClose: () => {}
};
const App = () => {
return (
Pay 2000
);
};
export default App;
```
For more usage example [check](/example/src)
## API
See the [API reference](https://link-to-github-pages).
## Deployment
WHEN DEPLOYING TO PRODUCTION/LIVE SYSTEM, take note of the following;
1. Change isProduction attribute in the component tag to true i.e isProduction={true}
2. Change RavePay PUBLIC KEY
3. Ensure you implement [webhooks](https://flutterwavedevelopers.readme.io/docs/events-webhooks) to receive automatic updates when a transaction happens.
## Contribution
1. Fork it!
2. Create your feature branch: `git checkout -b feature-name`
3. Commit your changes: `git commit -am 'Some commit message'`
4. Push to the branch: `git push origin feature-name`
5. Submit a pull request 😉😉
This project follows the [all-contributors](https://allcontributors.org/) specification.
Contributions of any kind welcome!
### Issues
Looking to contribute? Look for the Good First Issue label.
### 🐛 Bugs
Please file an issue for bugs, missing documentation, or unexpected behavior.
## License
MIT