1.0.2 • Published 6 years ago
kouber v1.0.2
kouber
Installation
$ npm install --save kouber
How to use
- Import
kouber
to your node project file (e.g.main.js
)
const { khaltiCheckout } = require("kouber");
- Call
khaltiCheckout
function with required arguments.
khaltiCheckout({productId: "123", publicKey: "test_public_key_dc74e0fd57cb46cd93832aee0a390234", productName: "Test product", productUrl: "https://example.com/", amount: 1000, buttonId: "khalti-payment-button", secretKey: "test_secret_key_12312lO"});
Now use the
browserify
command to build a bundle starting at your project file (main.js
in this example):- Install
browserify
(globally) with this command.
$ npm install browserify -g
- Bundle the project file.
$ browserify main.js -o main-bundle.js
- Install
Create a button in your HTML document with the
id
previously used inkhaltiCheckout
method. Import the bundled file to the HTML document.
<button id="khalti-payment-button">Pay with Khalti</button>
<script src="main-bundle.js"></script>
Todos
- Implement eSewa checkout for web