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

@paykernel/gateway-myfatoorah

v1.0.2

Published

Portable MyFatoorah gateway adapter for @paykernel/core: V3 hosted payments, refunds, and Webhook V2 signatures.

Readme

@paykernel/gateway-myfatoorah

Portable MyFatoorah adapter for @paykernel/core: V3 hosted payments (sale), refunds, and Webhook V2 signatures.

Portable. No Node-only imports. Runtime: Bun / Node ≥ 18 / Deno / Workers (Web fetch + core HMAC). Depends only on @paykernel/core at runtime.

This is a first-party extra package (Phase 23). It is not a BuiltInGatewayName. Stripe / Moyasar / PayPal / Paymob stay in core.

Install

bun add @paykernel/gateway-myfatoorah @paykernel/core

Quickstart

import { createPaymentClient, money } from "@paykernel/core";
import { myfatoorahGateway } from "@paykernel/gateway-myfatoorah";

const payments = createPaymentClient({
  gateways: {
    myfatoorah: myfatoorahGateway({
      apiToken: process.env.MYFATOORAH_API_TOKEN!, // sandbox: portal API token
      country: "KWT",
      // live: true, // use the live host for the country
      webhookSecret: process.env.MYFATOORAH_WEBHOOK_SECRET, // portal secure key, NOT the API token
      webhookUrl: "https://merchant.example/webhooks/myfatoorah",
      // defaultPaymentMethod: "KNET", // optional; omitted → all enabled methods
    }),
  },
  defaultGateway: "myfatoorah",
});

const result = await payments.createPayment({
  amount: money("10.50", "SAR"),
  currency: "SAR",
  callbackUrl: "https://merchant.example/return",
  idempotencyKey: crypto.randomUUID(), // required
  orderId: "ord_01", // required outside KWT/SAU (CustomerReference replay)
  // myfatoorahCustomer: { name: "Ada", email: "[email protected]" }, // optional
});

if (result.outcome === "requires_action" && result.redirectUrl) {
  // PaymentURL hosted page — redirect the customer, do not fulfill
}
if (result.outcome === "succeeded" && result.status === "paid") {
  // still verify via webhook + inbox claim before fulfillment
}

MyFatoorahGateway.createPayment accepts MyFatoorah-only myfatoorah* fields (myfatoorahCustomer, myfatoorahPaymentMethod, myfatoorahDisplayPaymentMethods, myfatoorahLanguage, myfatoorahWebhookUrl, myfatoorahSessionId, myfatoorahToken) as MyFatoorahCreatePaymentParams. With defaultGateway: "myfatoorah", or a MYFATOORAH-only gateways map without defaultGateway, payments.createPayment({ myfatoorahCustomer, … }) is typed the same way (core does not add myfatoorah* to CreatePaymentParams). Two or more gateways still need defaultGateway or a named gateway argument. createPayment requires idempotencyKey (no minted UUID). Request JSON amounts are ISO-padded number tokens (10.50 SAR, 1.200 KWD), never strings. gatewayId is the InvoiceId; getPayment uses POST /v2/GetPaymentStatus (InvoiceId/PaymentId via myfatoorahKeyType); PaymentURLrequires_action + redirectUrl. Outside KWT/SAU orderId or myfatoorahCustomer.reference is required (CustomerReference replay).

Capabilities

Claimed: payments, immediateCapture, refunds, partialRefunds, tokenization (via myfatoorahToken / myfatoorahSessionIdSourceOfFund.Token / SessionId; direct SourceOfFund.Card PAN is still rejected).

Unclaimed (fail-closed): authorization, partialCapture, voids, hostedCheckout, customers, paymentMethods, marketplaceSplits, disputes, paymentLinks, providerRecurring.

PaymentURL is a redirect, not a Checkout Session product. gateway.ts length/duplication is intentional for this gate — split deferred and documented.

Docs

License

MIT