1.2.9 • Published 8 months ago

@codemoon/phonepe-lib v1.2.9

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

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: klscse6@gmail.com
šŸ”— PhonePe Team: Contact PhonePe Support

Happy coding! šŸŽ‰

1.2.9

8 months ago

1.2.8

8 months ago

1.2.7

8 months ago

1.2.6

8 months ago

1.2.5

8 months ago

1.2.4

8 months ago

1.2.3

8 months ago

1.2.2

8 months ago

1.2.1

8 months ago

1.2.0

8 months ago

1.1.9

8 months ago

1.1.8

8 months ago

1.1.7

8 months ago

1.1.6

8 months ago

1.1.5

8 months ago

1.1.4

8 months ago

1.1.3

8 months ago

1.1.2

8 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.15

8 months ago

1.0.14

8 months ago

1.0.13

8 months ago

1.0.12

8 months ago

1.0.11

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.0

8 months ago