moru-web-sdk

1.0.3 • Public • Published

moru-web-sdk

NPM JavaScript Style Guide

Moru Payment Gateway web sdk Read Full Documentation.

Installation

yarn add moru-web-sdk
npm install moru-web-sdk

Usage

import { MoruCheckout } from 'moru-web-sdk';

function App() {
  const options = {
    access_key: 'test_9425294388834bdface7d1b58fd538bf67627d9408fe4f2589820cf550a5003d',
    transaction_id: '1',
    additional_fields: {
      name: 'Shubham Dhakal',
      email: 'shubham@gmail.com',
    },
    callback_handler: {
      onSuccess: (response) => {
        console.log(response);
        // call your api
        alert('success');
      },
      onError: (error) => {
        console.log(error);
        alert('failure');
      },
      onClose: (error) => {
        console.log(error);
      },
    },
  };
  const checkout = new MoruCheckout(options);
  const handleMoruPayment = () => {
    checkout.open({ amount: 100 });
  };
  return (
    <div>
      <button onClick={handleMoruPayment}>Pay with Moru</button>
    </div>
  );
}

export default App;

Demo

Moru web sdk demo

Readme

Keywords

none

Package Sidebar

Install

npm i moru-web-sdk

Weekly Downloads

12

Version

1.0.3

License

MIT

Unpacked Size

11.2 kB

Total Files

5

Last publish

Collaborators

  • sbmdkl