Skip to content

ppm-suman/payabbhi-node

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Payabbhi Node.js Library

Make sure you have signed up for your Payabbhi Account and downloaded the API keys from the Portal.

Requirements

Node.js v7.6.0 and later.

Installation

Install the package with:

npm install payabbhi --save

Documentation

Please refer to:

Usage

A typical usage of the Payabbhi Node Library is shown below:

const payabbhi = require('payabbhi')('<your-access-id>', '<your-secret-key>');


payabbhi.orders.create({
  merchant_order_id: "ORD_001",
  amount: 10000,
  currency: "INR"
}, (error, order) => {

  // error will be null if no error occurred
  // order is the created order object

});

Payment Signature Verification

Payabbhi Node library provides utility functions for verifying the payment signature received in the payment callback.

payabbhi.verifyPaymentSignature({
  "order_id": "<order-id>",
  "payment_id": "<payment-id>",
  "payment_signature": "<payment-signature>"
});

Webhook Signature Verification

Payabbhi Node library provides an utility function for webhook signature verification.

// replayInterval is optional. Default value is 300 seconds.
payabbhi.verifyWebhookSignature('<payload>','<actualSignature>', '<secret>', <replayInterval>);

Promise support

Payabbhi Node library supports the Promise API. Every method returns a promise which can be used instead of callbacks.

A typical usage of the library with promises is shown below:

payabbhi.orders.create({
  merchant_order_id: "ORD_001",
  amount: 10000,
  currency: "INR"
}).then(function (order) {
  ...
}).catch(function (error) {
  ...
});

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%