🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

payu-sdk

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

payu-sdk

Payu's Node API

1.1.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

Payu node SDK

Installation

Install package:

$ npm install payu-sdk

OR

$ yarn add payu-sdk

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')({
  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: '5512244',
  amount: '1000',
  productinfo: 'mobile',
  firstname: 'Jacob',
  email: 'test@payu.in',
});

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: '5512244',
  amount: '1000',
  productinfo: 'mobile',
  firstname: 'Jacob',
  email: 'test@payu.in',
  status: txnStatus,
})

Keywords

payu

FAQs

Package last updated on 27 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts