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

@codemoon/phonepe-lib

v1.2.9

Published

Welcome to the **Node.js Express PhonePe Payment Gateway Integration Package** πŸš€

Readme

Node.js Express PhonePe Payment Gateway Integration

Welcome to the Node.js Express PhonePe Payment Gateway Integration Package πŸš€


PhonePe For Business Registration

For official business registration, click:
πŸ”— Registration here

UAT Testing Credentials

MERCHANT_ID = "PGTESTSBUAT"; SALT_INDEX = 1; SALT_KEY = "7ab50f0c-a5d9-4bd1-b757-f7fe2fce8a48";

For testing purposes in the UAT environment, use the following credentials:

  • Card Number: 4242424242424242
  • Expiry Month: 12
  • Expiry Year: 44
  • CVV: 936
  • OTP: 123456

Demo Project Implement This PhonePe Library

This repository provides an integration of the PhonePe Payment Gateway with Node.js and Express. It allows you to handle payments, refunds, and transaction status checks using the PhonePe API:

# Clone the repository
git clone https://github.com/kaviyarasanofficial/Node.js-Express-PhonePe-Payment-Gateway-Integration.git

# Navigate to the project folder
cd Node.js-Express-PhonePe-Payment-Gateway-Integration

# Install dependencies
npm install

Install Dependencies

Run the following command to install the required package:

npm i @codemoon/phonepe-lib

Import the Package

const { phonePe, phonePePayAmount, phonePeCheckMerchantId } = require('@codemoon/phonepe-lib');

Initiate Payment Request

To generate a payment URL, use the following function:

API Testing Mode

isLive = false

API Live Mode

isLive = true
const result = await phonePePayAmount(
  isLive,
  amount,
  userId,
  APP_BE_URL,
  mobile,
  MERCHANT_ID,
  SALT_INDEX,
  SALT_KEY
);
  • APP_BE_URL: The backend URL where your Node.js server is running. Example:

    APP_BE_URL = "http://localhost:3002/";
  • MERCHANT_ID, SALT_INDEX, SALT_KEY: These credentials will be provided by the PhonePe business registration then get call from phonepe team ..

  • userId : this is getting from payment user id its unique

PhonePe For Business Registration

For official business registration, click:
πŸ”— Registration here


Check Payment Status

API Testing Mode

isLive = false

API Live Mode

isLive = true

To verify whether the payment was successful or failed, use the following function:

const result = await phonePeCheckMerchantId(
  merchantTransactionId,
  MERCHANT_ID,
  SALT_INDEX,
  SALT_KEY
);

Check Refund Status

API Testing Mode

isLive = false

API Live Mode

isLive = true

To verify whether the payment was successful or failed, use the following function:

const result = await phonePePayRefundCheck(
  isLive,
  amount,
  merchantId,
  merchantUserId,
  merchantTransactionId,
  originalTransactionId,
  callbackUrl,
  saltKey,
  saltIndex
);

merchantUserId :- User Id passed in the debit request merchantTransactionId :- Unique Refund Transaction ID generated by the merchant. originalTransactionId :- The actual merchantTransactionId used in the Pay API call generated by the merchant for accepting the forward payments.


PhonePe For Business Registration

For PhonePe official business registration, click:
πŸ”— Registration Link Click here

PhonePe Support

For official documentation and support, visit:
πŸ”— PhonePe Developer Docs


How to Run Demo Project

Clone the project: git clone https://github.com/kaviyarasanofficial/Node.js-Express-PhonePe-Payment-Gateway-Integration.git

Install dependencies: npm install

Run the app: npm run start

Contact Information

For any inquiries, collaborations, or development work, feel free to reach out:

πŸ“§ Email: [email protected]
πŸ”— PhonePe Team: Contact PhonePe Support

Happy coding! πŸŽ‰