klasha-pay
v1.2.6
Published
<!-- @format -->
Downloads
13
Readme
react-klasha
This is a react library for implementing klasha payment gateway
Demo
Get Started
This React library provides a wrapper to add Klasha Payments to your React application
Install
npm install klash-pay --save
Usage
import React from 'react';
import useKlashaPayment from 'klasha-pay';
const App = () => {
const callBack = (response) => {
console.log(response);
};
const kit = {
currency: 'NG',
phone_number: '+2347038521460',
email: '[email protected]',
fullname: 'Klasha Apps',
tx_ref: '',
paymentType: '',
};
const initializePayment = useKlashaPayment({
isTestMode: true,
email: '[email protected]',
merchantKey: 'the merchant public key in klahsa dashboard',
businessId: 'business_unique_id',
amount: 1000,
tx_ref: 'tax_ref',
fullname: 'Klasha Apps',
kit: {
currency: 'NGN',
tx_ref: 'tax_red',
paymentType: 'bulkpayment',
fullname: 'Klasha Apps',
email: '[email protected]',
phone_number: '+234example-phone.',
callBack: callWhenDone,
},
paymentDescription: 'Add funds to wallet',
});
return (
<div>
<p>
<button
type="button"
onClick={initializePayment}
>
pay
</button>
</p>
</div>
);
};
export default App;
;
Deployment
REMEMBER TO CHANGE THE TEST MODE WHEN DEPLOYING ON A LIVE/PRODUCTION SYSTEM
Contributing
- Fork it!
- Create your feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -am 'Some commit message'
- Push to the branch:
git push origin feature-name
- Submit a pull request
Thanks! Klasha.
License
This project is licensed under the MIT License - see the LICENSE.md file for details