README
React-Korapay
This is a react package for implementing korapay collection gateway
Installation
npm install react-korapay
# or
yarn add react-korapay
Examples
- Basic - CodeSandbox
import React from "react";
import { useKorapay, KorapayButton } from "react-korapay";
const config = {
public_key: "pk_test_**your_public_key**",
amount: 2000,
customer: {
name: "John doe",
email: "johndoe@gmail.com"
},
narration: "Testing korapay"
};
export default function App() {
const korapayBtnConfig = {
...config,
onClose: () => {},
onSuccess: () => {},
text: "Pay with korapay!"
};
const handleKorapay = useKorapay(config);
return (
<div className="App">
<h1>React Wrapper for Korapay collections</h1>
<h2>Check it out!</h2>
<div>
<button
onClick={() =>
handleKorapay({
onClose: () => {},
onSuccess: () => {}
})
}
>
Pay now!
</button>
<KorapayButton {...korapayBtnConfig} />
</div>
</div>
);
}
Please checkout Korapay 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 ✨
Special thanks to Ayeni Olusegun, your work on react-paystack helped alot!
- 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
This project follows the all-contributors specification. Contributions of any kind welcome!