react-gladepay-2
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

react-gladepay

This is a react library for implementing gladepay payment gateway

Demo

Demo

Get Started

This React library provides a wrapper to add Gladepay Payments to your React application

Install

npm install react-gladepay-2 --save

or with yarn

yarn add react-gladepay-2

Usage

    import React, { Component } from 'react';
    //import the library
    import GladepayButton from 'react-gladepay';
 
    class App extends Component {
 
     state = {
     MID: "GP0000001", //Gladepay Merchant ID
     email: "demo@gmail.com",  // customer email
        amount: 10000 //equals NGN100,
        is_production: false //is_production,
     }
 
     callback = (response) => {
     console.log(response); // card charged successfully, get reference here
     }
 
     close = () => {
     console.log("Payment closed");
     }
 
      render() {
        return (
          <div>
            <p>
              <GladepayButton
                text="Make Payment"
                className="payButton"
                callback={this.callback}
                close={this.close}
                disabled={true} {/*disable payment button*/}
                embed={true} {/*payment embed in your app instead of a pop up*/}
                email={this.state.email}
                amount={this.state.amount}
                MID={this.state.MID}
                tag="button"{/*it can be button or a or input tag */}
              />
            </p>
          </div>
        );
      }
    }
 
    export default App;

Please checkout Gladepay Documentation for other available options you can add to the tag

Deployment

REMEMBER TO CHANGE THE MID 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 😉😉

How can I thank you?

Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or Any Social Media? Spread the word!

Don't forget to follow me on twitter!

Thanks! Adekanbi Dansteve.

License

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

Dependents (0)

Package Sidebar

Install

npm i react-gladepay-2

Weekly Downloads

31

Version

1.0.2

License

MIT

Unpacked Size

1.04 MB

Total Files

57

Last publish

Collaborators

  • dansteveade