fathah / phonepepg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Easily integrate PhonePe Payment Gateway

PhonePe PG

⚠️ You Need a PhonePe Business account to use this

If you dont have have an account create one by the following link


Getting Started

This package package can be used for server-side working with Node.js or Other Server ation supported frameworks like Next.js etc

Install the Package

npm i phonepepg

Usage

Required Parameters:

param required
merchantId true
saltKey true
isDev false

Create an Instance of PhonepeGateway

import PhonepeGateway from 'phonepepg';

const gateway = new PhonepeGateway({
    merchantId: 'MYMERCHANTID',
    saltKey: 'XXXXXXXXXXXXXXXXXXX',
    isDev: true // false for production
  });

Initialize Payment

const resp = await gateway.initPayment({
    amount:100, 
    transactionId:'TR12345', 
    userId:'userid', 
    redirectUrl:'https://mysite.com/payredirect',
    callbackUrl:'https://mysite.com/callback'
    });

Get Payment Status

const resp = await gateway.paymentStatus(transactionId);

Get Checksum

const checksome = gateway.getChecksum(transactionId);

Contribute

This package is still in development. Click to Contribute

License

MIT License

Copyright (c) 2024

ziqx.cc

About

License:MIT License


Languages

Language:TypeScript 100.0%