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

@payfanout/adapter-payzen-server

v1.1.1

Published

Server-side PayZen (Lyra) adapter for PayFanout (REST API V4: payments, validation capture, refunds, IPN verification). Holds secrets — never bundle client-side.

Readme

@payfanout/adapter-payzen-server

Server-side PayZen (Lyra) adapter for PayFanout: payments, validation capture, refunds, and IPN verification over the PayZen REST API V4.

Holds secrets. This package uses your PayZen REST password. Never bundle it client-side.

It implements the ServerPaymentAdapter contract from @payfanout/core, so @payfanout/server drives it through the same unified API as every other PSP. It talks to the REST API directly and is edge-runtime compatible (WebCrypto only, no Node builtins), so it runs on Cloudflare Workers and Next.js edge routes.

📖 Documentation: https://donapulse.github.io/payfanout/ · Set up PayZen · Server usage

Installation

pnpm add @payfanout/server @payfanout/adapter-payzen-server

@payfanout/core comes in transitively.

Usage

import { PaymentService } from "@payfanout/server";
import { PayZenServerAdapter } from "@payfanout/adapter-payzen-server";

const payzen = new PayZenServerAdapter({
  shopId: process.env.PAYZEN_SHOP_ID!,       // Back Office "User"
  password: process.env.PAYZEN_PASSWORD!,    // testpassword_… / prodpassword_…
  environment: "sandbox",                    // validated against the key family
  hmacKey: process.env.PAYZEN_HMAC_KEY,      // browser-return kr-answer validation
});

const payments = new PaymentService({ adapters: [payzen] });

This is a confirm-on-client PSP: createPaymentSession returns a short-lived formToken as clientSecret, the krypton-client form in the browser creates the transaction (3DS2 inline), and the server reads outcomes via retrievePayment and the IPN. There is no completePayment step.

What's inside

  • PayZenServerAdapter — sessions (Charge/CreatePayment), reads (Transaction/Get, Order/Get), manual capture via Transaction/Validate, cancel/refund (Transaction/Cancel, Transaction/Refund, Transaction/CancelOrRefund), and IPN signature verification (HMAC-SHA-256 over the raw kr-answer, both key families, rotation arrays).
  • Synthesized idempotency — PayZen has no idempotency mechanism, so the adapter derives a deterministic orderId from your idempotencyKey, stamps it into transaction metadata, and never auto-retries refund-class calls. See the PayZen guide for the residual caveats (never blind-retry refunds).
  • Errors normalize into PayFanout's taxonomy — PayZen answers HTTP 200 even for failures, so the envelope (INT_/PSP_/ACQ_/AUTH_ codes) drives the mapping and the untouched envelope always rides raw.

Pair it in the browser with @payfanout/adapter-payzen, which mounts the embedded card form the formToken feeds.

Documentation

License

MIT