This is a react library for implementing klasha payment gateway
This React library provides a wrapper to add Klasha Payments to your React application
npm install klash-pay --save
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: 'klashapps@klasha.com',
fullname: 'Klasha Apps',
tx_ref: '',
paymentType: '',
};
const initializePayment = useKlashaPayment({
isTestMode: true,
email: 'apps@klasha.com',
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: 'apps@klasha.com',
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;
;
REMEMBER TO CHANGE THE TEST MODE WHEN DEPLOYING ON A LIVE/PRODUCTION SYSTEM
- 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.
This project is licensed under the MIT License - see the LICENSE.md file for details