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 🙏

© 2025 – Pkg Stats / Ryan Hefner

paiementfactory

v1.0.7

Published

Unified SDK for multiple payment gateways (Easebuzz, Razorpay, etc.)

Readme

💳PaiementFactory

PaiementFactory is a simple, powerful, and flexible Node.js module that allows you to integrate multiple payment gateways through a single, unified interface.

Whether you're starting with one provider or planning to support many, PaiementFactory makes it easy to plug in different payment gateways and switch between them effortlessly — with zero hassle and minimal code changes.


✨ Features

  • 🔌 Plug & Play – Integrate gateways like Razorpay, Easebuzz, and more (coming soon)
  • 🧼 Unified API – One clean, consistent interface for all providers
  • Quick Integration – Get up and running in minutes

📚 Available Methods

Each payment gateway has the following common methods:

create(gateway, config) { } 
#Initializes the payment gateway with the provided configuration.
initiatePayment(data) {
  return Promise.resolve();
} 
#Initiates a payment with the given data.
Parameters: 
  data (Object): Includes amount, customer info, callback URL, etc.

Returns: 
  Promise: Resolves with the payment initiation response from the gateway.
checkPaymentStatus(data) {
  return Promise.resolve();
} 
Checks the current status of a transaction or payment using provided identifiers.
  
Parameters:
  data (Object): Includes transaction ID, order ID, or reference ID.

Returns:
  Promise: Resolves with the status response.
validateSignature(data) { }
#Validates the gateway's signature to confirm the authenticity of received data.

Parameters:
  data (Object): Typically contains payload and signature.

Returns:
  boolean: true if the signature is valid; otherwise false.

📦 Installation

To install the package, run:

npm install paiementfactory

🚀 Quick Start with Razorpay

Here's a simple example of how to use PaiementFactory with Razorpay:

const PaymentFactory = require('paiementfactory')

const config = {
    RAZORPAY_KEY: process.env.RAZORPAY_KEY,
    RAZORPAY_SECRET: process.env.RAZORPAY_SECRET,
}

const paymentGateway = PaymentFactory.create('razorpay', config)

const data = {
    amount: 100
    user: {
      name : "John Doe",
      email : "[email protected]",
      phone_number : "9876543211",
    }
    description = "Testing PG Integration"
    callback_url = "http://localhost:3000/success" //Front End url
    notes = {
      order_id: 'TEST_ORD_12345',
      user_id: 'TEST_USER_98765',
      purpose: 'Test Membership Purchase'
    }
}

const result = await paymentGateway.initiatePayment(data)

console.log(result);

🚀 Quick Start with Easebuzz

Here's a simple example of how to use PaiementFactory with Easebuzz:

ENV Test:

EASEBUZZ_HOST=https://testpay.easebuzz.in EASEBUZZ_HOST_DASHBOARD=https://testdashboard.easebuzz.in

ENV Prod:

EASEBUZZ_HOST=https://pay.easebuzz.in EASEBUZZ_HOST_DASHBOARD=https://dashboard.easebuzz.in

const PaymentFactory = require('paiementfactory')

const config = {
    EASEBUZZ_KEY: process.env.EASEBUZZ_KEY,
    EASEBUZZ_SALT: process.env.EASEBUZZ_SALT,
    EASEBUZZ_HOST: process.env.EASEBUZZ_HOST,
    EASEBUZZ_HOST_DASHBOARD: process.env.EASEBUZZ_HOST_DASHBOARD,
}

const paymentGateway = PaymentFactory.create('easebuzz', config)

const data = {
    transactionID: 'tnxid123',
    amount: 1,
    productinfo: 'OnlinePayment',
    user: {
      name: 'John Doe',
      phone_number: '9876543211',
      email: '[email protected]'
    }
}

const result = await paymentGateway.initiatePayment(data)

console.log(result);