@codemoon/phonepe-lib v1.2.9
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 installInstall Dependencies
Run the following command to install the required package:
npm i @codemoon/phonepe-libImport 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 = falseAPI Live Mode
isLive = trueconst 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 = falseAPI Live Mode
isLive = trueTo verify whether the payment was successful or failed, use the following function:
const result = await phonePeCheckMerchantId(
merchantTransactionId,
MERCHANT_ID,
SALT_INDEX,
SALT_KEY
);MERCHANT_ID,SALT_INDEX,SALT_KEY: These credentials will be provided by the PhonePe business registration then get call from phonepe team .
Check Refund Status
API Testing Mode
isLive = falseAPI Live Mode
isLive = trueTo 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.
MERCHANT_ID,SALT_INDEX,SALT_KEY: These credentials will be provided by the PhonePe business registration then get call from phonepe team .
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: klscse6@gmail.com
š PhonePe Team: Contact PhonePe Support
Happy coding! š
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago