klasha-pay

1.2.6 • Public • Published

react-klasha

This is a react library for implementing klasha payment gateway

Demo

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: '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;
;

Deployment

REMEMBER TO CHANGE THE TEST MODE WHEN DEPLOYING ON A LIVE/PRODUCTION SYSTEM

Contributing

  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

Thanks! Klasha.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Readme

Keywords

none

Package Sidebar

Install

npm i klasha-pay

Weekly Downloads

6

Version

1.2.6

License

none

Unpacked Size

165 kB

Total Files

20

Last publish

Collaborators

  • klasha