react-korapay

This is a react package for implementing korapay collection gateway

Usage no npm install needed!

<script type="module">
  import reactKorapay from 'https://cdn.skypack.dev/react-korapay';
</script>

README

React-Korapay

Demo

This is a react package for implementing korapay collection gateway

Installation

npm install react-korapay
# or
yarn add react-korapay

Examples

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!

  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 specification. Contributions of any kind welcome!