Skip to content

k-kitchen/klasha-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published