Nodejs library to accept ipay (ipay.com.bd) payments on your backend application
- Implements all the methods required to get accepted as a merchant on ipay
- Written in typescript
- Get intellisense in when interacting with the library
vscode
- Get Documentation and examples right inside your code editor
vscode
- Get ipay Response Intellisense
- Get Human Readable exceptions when some error response is returned from ipay
in progress
npm install ipay-payment-gateway
yarn add ipay-payment-gateway
file
ipay.js
const IpayGateway = require('ipay-payment-gateway');
const ipayConfig = {
baseURL: 'https://demo.ipay.com.bd/api/pg', //do not add a trailing slash
key: 'abcxxxxxxxxxxxxxx',
successUrl: 'https://example.com/success',
failureUrl: 'https://example.com/failure',
cancelUrl: 'https://example.com/cancel',
};
const Ipay = new IpayGateway(ipayConfig);
module.exports = Ipay;
file
ipay.ts
import IpayGateway, { IpayConstructor } from 'ipay-payment-gateway';
const ipayConfig: IpayConstructor = {
//get intellisense here
baseURL: 'https://demo.ipay.com.bd/api/pg', //do not add a trailing slash
key: 'abcxxxxxxxxxxxxxx',
successUrl: 'https://example.com/success',
failureUrl: 'https://example.com/failure',
cancelUrl: 'https://example.com/cancel',
};
const Ipay = new IpayGateway(ipayConfig);
export default Ipay;
const paymentRequest = {
amount: 1000,
referenceId: 'Ref-abcxxxx',
description: 'Payment for something',
successUrl: 'https://example.com/success', //optional
failureUrl: 'https://example.com/failure', //optional
cancelUrl: 'https://example.com/cancel', //optional
};
//optional - you can set a different URL. Else it will use the main config URL.
const result = await Ipay.createPayment(paymentRequest);
console.log(result);
const result = await Ipay.checkStatusByRefId('<Reference ID you have passed while creating the order.>');
const result = await Ipay.checkStatusByOrderId('Order ID returned by ipay');
- Please Follow the code style and use the prettier config and eslint config provided in the repository
- Feel free to open
issues
orpull request
for any issues and bugfixes - If you want to implement new features or write documentation about existing features feel free to do it as well
- To see a list of missing features or to-do's, please visit the
project
section of the github repository
MIT
DISCLAIMER: This software comes with absolutely no warranty and is not affiliated with the company
ipay (ipay.com.bd)
in any way. Use at your own risk. Author and Contributors are not responsible for any financial damages, outages etc.