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

gmm-gateway

v1.3.12

Published

A lightweight, developer-friendly payment gateway SDK for creating checkout sessions and verifying secure webhooks.

Readme

🚀 GMM Gateway SDK

A lightweight, developer-friendly payment gateway SDK for creating checkout sessions and verifying secure webhooks.

Inspired by Stripe-style simplicity.


📦 Installation

yarn add gmm-gateway
# or
pnpm add gmm-gateway
# or
npm install gmm-gateway

🔑 Get API Credentials

Before using the SDK, you need to create an account and get your API keys.

👉 https://payment-gateway.zsi.ai

From the dashboard, you can:

  • Create projects
  • Generate API Key & Secret
  • Configure Webhooks
  • Switch between sandbox and production

⚡ Initialization

Import and initialize the GMMGateway client with your API credentials.

import { GMMGateway } from "gmm-gateway";

const gmm = new GMMGateway({
  apiKey: "your_api_key",
  apiSecret: "your_api_secret",
  origin: "https://your-domain.com",
  environment: "sandbox", // "sandbox" | "production"
  webhookSecret: "your_webhook_secret",
});

⚙️ Configuration Options

| Property | Type | Required | Description | | ------------- | ------------------------- | -------- | ---------------------------------- | | apiKey | string | ✅ Yes | Your GMM API Key | | apiSecret | string | ✅ Yes | Your GMM API Secret | | origin | string | ✅ Yes | Your application domain | | webhookSecret | string | ❌ No | Secret for verifying webhooks | | environment | "sandbox" | "production" | ❌ No | Defaults to sandbox | | timeout | number | ❌ No | Request timeout in milliseconds | | maxRetries | number | ❌ No | Retry attempts for failed requests |

💳 Usage

1. Create Checkout Session

Generate a secure checkout URL and redirect your user.

import { GMMGateway } from "gmm-gateway";

const gmm = new GMMGateway({
  apiKey: process.env.GMM_API_KEY!,
  apiSecret: process.env.GMM_API_SECRET!,
  origin: "https://your-domain.com",
});

async function createCheckout() {
  try {
    const session = await gmm.sessions.create({
      customer_email: "[email protected]",
      currency: "USD",
      items: [
        {
          id: "item_123",
          name: "Premium Subscription",
          quantity: 1,
          price: 5000,
        },
      ],
      metadata: {
        orderId: "ord_98765",
        customerId: "cust_123",
      },
    });

    console.log("Redirect URL:", session.checkout_url);

    // Redirect your user to session.checkout_url
  } catch (error: any) {
    console.error("Checkout failed:", error.message);
  }
}

2. Retrieve Checkout Session by Track ID

Retrieve a checkout session using its unique tracking ID.

This method is commonly used on merchant success or cancel pages to verify payment status and display transaction details.

import { GMMGateway } from "gmm-gateway";

const gmm = new GMMGateway({
  apiKey: process.env.GMM_API_KEY!,
  apiSecret: process.env.GMM_API_SECRET!,
  origin: "https://your-domain.com",
});

async function getSession() {
  try {
    const session = await gmm.sessions.findByTrackId("7107319375257");

    console.log(session);
  } catch (error: any) {
    console.error("Failed to retrieve session:", error.message);
  }
}

3. Verify Webhooks

GMM Gateway sends webhook events to notify your system about payment updates.

⚠️ Important: You must use the raw request body.

Example (Express.js)

import express from "express";
import { GMMGateway } from "gmm-gateway";

const app = express();

const gmm = new GMMGateway({
  apiKey: process.env.GMM_API_KEY!,
  apiSecret: process.env.GMM_API_SECRET!,
  origin: "https://your-domain.com",
  webhookSecret: process.env.GMM_WEBHOOK_SECRET!,
});

app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => {
  const rawBody = req.body.toString("utf8");

  const signature = req.headers["gmm-webhook-signature"] as string;
  const timestamp = req.headers["gmm-webhook-timestamp"] as string;

  try {
    const event = gmm.webhooks.constructEvent({
      rawBody,
      headers: {
        "gmm-webhook-signature": signature,
        "gmm-webhook-timestamp": timestamp,
      },
    });

    console.log("✅ Verified webhook:", event);

    // Handle your event here
    // Example:
    // if (event.type === "payment.success") { ... }

    res.status(200).send("Webhook received");
  } catch (err: any) {
    console.error("❌ Webhook verification failed:", err.message);
    res.status(400).send(`Webhook Error: ${err.message}`);
  }
});

app.listen(5000, () => {
  console.log("Server running on port 5000");
});

📄 License

This project is licensed under the ISC License.

See the LICENSE file for details.

Copyright (c) 2026, GMM Gateway

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.