Payabbhi Node.js Library http://payabbhi.com
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
.gitignore
.npmignore
.npmrc
CHANGELOG.md
LICENSE
README.md
package.json

README.md

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) {
  ...
});