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

gembapay

v1.2.0

Published

GembaPay — unified payment gateway for Stripe card payments and PayPal. Funds settle directly to the merchant.

Downloads

94

Readme

GembaPay

Unified payment gateway for cards and PayPal.

Accept credit cards (via Stripe) and PayPal through a single API. Funds settle directly into the merchant's own connected account — GembaPay never holds your money.

npm License: MIT


Features

  • One API, two payment methods — Stripe (cards/Apple Pay/Google Pay) and PayPal
  • Direct settlement — Payments route straight into your own Stripe or PayPal account
  • 86+ currencies — Price in any supported currency
  • Test mode built-in — Stripe and PayPal sandbox environments for development
  • TypeScript support — Full type definitions included
  • Zero dependencies — Uses only Node.js built-in modules

Install

npm install gembapay

Quick Start

const GembaPay = require('gembapay');

const gembapay = new GembaPay({
  apiKey: 'gembapay_test_your_key',  // test key for development
  webhookSecret: 'your_webhook_secret'
});

// Create a payment
const payment = await gembapay.createPayment({
  orderId: 'ORDER-123',
  amount: 100.00,
  currency: 'EUR'
});

console.log(payment.paymentUrl);
// → https://payment.gembapay.com/checkout/3f9c1e7a-2b4d-4c8e-9f10-a2b3c4d5e6f7

console.log(payment.allowedMethods);
// → ['stripe', 'paypal']

Usage

Create Payment

const payment = await gembapay.createPayment({
  orderId: 'ORDER-456',
  amount: 49.99,
  currency: 'USD',
  description: 'Premium Plan'
});

// Redirect customer to unified checkout
// Redirect to payment.paymentUrl as-is (unguessable token, not your orderId)
res.redirect(payment.paymentUrl);

Check Status

const status = await gembapay.getPaymentStatus('ORDER-456');

console.log(status.status);   // 'completed'
console.log(status.network);  // 'bsc', 'stripe', 'paypal', etc.

Webhook Verification

⚠️ SDK update required. The live GembaPay backend signs webhooks as bare hex (no sha256= prefix) over the raw request body. The current verifyWebhook/webhookHandler in this SDK build expect a sha256= prefix and hash the parsed body, so they reject genuine webhooks until the SDK is updated. Until then, verify manually against the raw body per docs/webhooks.md. Subscription cycles arrive as subscription.payment (flat payload, no orderId), not payment.completed.

const express = require('express');
const app = express();

app.post('/webhooks/gembapay', express.json(), 
  gembapay.webhookHandler(async (event) => {
    if (event.event === 'payment.completed') {
      console.log(`✓ Order ${event.payment.orderId} paid`);
      console.log(`  $${event.payment.usdAmount} via ${event.payment.network}`);
      await fulfillOrder(event.payment.orderId);
    }
  })
);

Or verify manually:

app.post('/webhooks/gembapay', express.json(), (req, res) => {
  const signature = req.headers['x-gembapay-signature'];
  
  if (!gembapay.verifyWebhook(req.body, signature)) {
    return res.status(401).send('Invalid signature');
  }
  
  const { event, payment, testMode } = req.body;
  // Process event...
  
  res.json({ received: true });
});

Transactions & Stats

const stats = await gembapay.getStats();
// const transactions = await gembapay.listTransactions();  // see note below

Note: listTransactions() currently targets a dashboard (JWT) endpoint and returns 401 with an API key. Use getStats() / getPaymentStatus() programmatically, or view transactions in the dashboard, until the SDK/endpoint is aligned.

Test Mode

Use test API keys (gembapay_test_...) for development. Test mode automatically uses:

| Method | Test Environment | |--------|-----------------| | Stripe | Test cards (4242 4242 4242 4242) | | PayPal | Sandbox accounts |

// SDK detects test mode from your API key
const gembapay = new GembaPay({
  apiKey: 'gembapay_test_your_key'
});

console.log(gembapay.isTestMode); // true

Claim free test tokens at Developer Resources.

Express.js Example

const express = require('express');
const GembaPay = require('gembapay');
const app = express();

const gembapay = new GembaPay({
  apiKey: process.env.GEMBAPAY_API_KEY,
  webhookSecret: process.env.GEMBAPAY_WEBHOOK_SECRET
});

// Create payment endpoint
app.post('/api/checkout', express.json(), async (req, res) => {
  const { orderId, amount, currency } = req.body;
  
  try {
    const payment = await gembapay.createPayment({ orderId, amount, currency });
    res.json({ paymentUrl: payment.paymentUrl });
  } catch (err) {
    res.status(err.statusCode || 500).json({ error: err.message });
  }
});

// Webhook endpoint
app.post('/webhooks/gembapay', express.json(),
  gembapay.webhookHandler(async (event) => {
    if (event.event === 'payment.completed') {
      await fulfillOrder(event.payment.orderId);
    }
  })
);

app.listen(3000);

API Reference

new GembaPay(options)

| Option | Type | Required | Description | |--------|------|----------|-------------| | apiKey | string | ✓ | API key from Merchant Dashboard | | webhookSecret | string | | Webhook signing secret | | baseUrl | string | | Custom API URL (default: https://api.gembapay.com) | | timeout | number | | Request timeout in ms (default: 30000) |

Methods

| Method | Description | |--------|-------------| | createPayment(params) | Create payment request → returns paymentUrl | | getPayment(orderId) | Get payment details | | getPaymentStatus(orderId) | Check payment status | | listTransactions(params?) | List merchant transactions | | getStats() | Get merchant statistics | | verifyWebhook(payload, signature) | Verify webhook signature | | parseWebhook(req) | Parse & verify Express request | | webhookHandler(fn) | Express webhook middleware |

Fee Structure

| Method | Fee | |--------|-----| | Stripe (Cards, Apple Pay, Google Pay) | 1% + €0.20 + Stripe fees | | PayPal (Balance, Bank, Pay Later) | 1% + €0.20 + PayPal fees |

Links

Support

License

MIT © GEMBA EOOD