1.1.1 • Published 1 year ago

payu-sdk-node-index-fixed v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Payu node SDK

Installation

Install package:

$ npm install payu-sdk-node-index-fixed

OR

$ yarn add payu-sdk-node-index-fixed

Usage

Next, you need to bootstrap using key and salt by following: key & salt can be found in your payu dashboard

const payu = require('payu-sdk-node-index-fixed')({
  key: '<payu_key>',
  salt:  '<payu_salt>', // should be on server side only
});

It is recommended to keep key and salt as env variables so that they are not pushed to git accidentally

Hash API

const hash = payu.hasher.generateHash({
  txnid: '20201223',
  amount: '1000',
  productinfo: 'iPhone',
  firstname: 'Ashish',
  email: 'ashish.25@mailinator.com',
});

Verify reverse hash received from payu after checkout

const reverseHash = '<payu_hash>' // hash received after payment from payu
const txnStatus = '<payu_txn_status>' // status received after payment from payu
const isValidHash = payu.hasher.validateHash(reverseHash, {
  txnid: '20201223',
  amount: '1000',
  productinfo: 'iPhone',
  firstname: 'Ashish',
  email: 'ashish.25@mailinator.com',
  status: txnStatus,
})
1.1.1

1 year ago

1.1.0

1 year ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago