This is a react package for implementing flutterwave collection gateway
npm install react-flutterwave> This is a react package for implementing Flutterwave collection gateway
``bash`
$ npm install react-flutterwaveor
$ yarn add react-flutterwave
`javascript
import React from 'react';
import { useFlutterwave, FlutterWaveButton } from 'react-flutterwave';
export default function App() {
const config = {
public_key: 'YOUR_FW_PUBLIC_KEY',
tx_ref: Date.now(),
amount: 100,
currency: 'NGN',
payment_options: 'card,mobilemoney,ussd',
customer: {
email: 'user@gmail.com',
phonenumber: '08102909304',
name: 'yemi desola',
},
customizations: {
title: 'My store',
description: 'Payment for items in cart',
logo: 'https://assets.piedpiper.com/logo.png',
},
};
const handleFlutterPayment = useFlutterwave(config);
const fwConfig = {
...config,
text: 'Pay with Flutterwave!',
callback: (response) => {
console.log(response);
},
onClose: () => {},
};
return (
onClick={() => {
handleFlutterPayment({
callback: (response) => {
console.log(response);
},
onClose: () => {},
});
}}
>
Testing FW Payment
Please checkout
Flutterwave Documentation
for other available options you can add to the tag
License
This project is licensed under the MIT License - see the LICENSE.md
file for details
Contributions ✨
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`Follow on Twitter @somtougeh
This project follows the
all-contributors
specification. Contributions of any kind welcome!