npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hesabe-pay/embedded-hosted-checkout

v1.0.14

Published

Hesabe Payments JavaScript SDK for embedded payment processing

Readme

@hesabe-pay/embedded-hosted-checkout

JavaScript SDK for Hesabe payment gateway integration with support for KNET, Credit/Debit Cards (MPGS), and Apple Pay.

Installation

Via CDN

<script src="https://unpkg.com/@hesabe-pay/embedded-hosted-checkout@latest/cdn/hesabe-payments.min.js"></script>

Via NPM

npm install @hesabe-pay/embedded-hosted-checkout
<script src="node_modules/@hesabe-pay/embedded-hosted-checkout/cdn/hesabe-payments.min.js"></script>

Usage

Basic Setup

  1. Create a container element in your HTML:
<div id="hesabe-payments"></div>
  1. Initialize the payment form:
const config = {
    environment: "sandbox", // or "production"
    sessionID: "pass checkout response data",
    paymentTypes: ["knet", "card", "applepay"],
    debug: true,
    callback: function(result) {
        console.log('Payment result:', result);
        // Handle payment result
        if (result.status === 'SUCCESS') {
            console.log('Payment successful:', result.data);
        } else if (result.status === 'FAILED') {
            console.log('Payment failed:', result.data);
        } else if (result.status === 'ERROR') {
            console.log('Payment initiz error');
        } else if (result.status === 'CANCELLED') {
            console.log('Payment cancelled');
        }
    }
};

hesabePayment.init(config);

Configuration Options

| Option | Type | Required | Description | |--------|------|----------|-------------| | environment | string | Yes | Environment: "sandbox", "production" | | sessionID | string | Yes | session data from Hesabe Checkout API response | | paymentTypes | array | Yes | Payment methods: ["knet", "card", "applepay"] | | callback | function | No | Callback function for payment results | | debug | boolean | No | Enable debug logging (default: false) |

Payment Types

  • knet - KNET debit card payments
  • card - Credit/Debit card payments via MPGS
  • applepay - Apple Pay payments (Safari only)

Callback Response

The callback function receives a response object with the following structure:

{
    status: "SUCCESS" | "FAILED" | "CANCELLED" | "ERROR",
    method: "knet" | "card" | "applepay",
    data: {
        // Transaction details
        token: "transaction_token",
        amount: "10.000",
        currency: "KWD",
        status: "SUCCESS"
        // ... other transaction data
    }
}

Example

<!DOCTYPE html>
<html>
<head>
    <title>Hesabe Payments Example</title>
    <script src="https://unpkg.com/@hesabe-pay/embedded-hosted-checkout@latest/cdn/hesabe-payments.min.js"></script>
</head>
<body>
    <div id="hesabe-payments"></div>

    <script>
        // Your session data from Hesabe API checkout response
        const sessionData = "eyJ0eXAiOiJKV1QiLCJhbGc..."; 

        const config = {
            environment: "sandbox",
            sessionID: sessionData,
            paymentTypes: ["knet", "card", "applepay"],
            debug: true,
            callback: function(result) {
                if (result.status === 'SUCCESS') {
                    console.log('Transaction:', result.data);
                } else {
                    console.log('Payment failed: ' + result.data);
                }
            }
        };

        // Initialize payment form
        hesabePayment.init(config);
    </script>
</body>
</html>

Browser Support

  • Chrome 60+
  • Firefox 55+
  • Safari 12+
  • Edge 79+

Features

  • ✅ Responsive design
  • ✅ Multiple payment methods
  • ✅ Real-time validation
  • ✅ Transaction verification
  • ✅ Loading states and animations

Support

For technical support or questions, please contact Hesabe support team.

License

MIT