### Installing Payu Node SDK Source: https://github.com/payu-india/payu-sdk-node/blob/main/README.md Provides commands to install the Payu Node.js SDK using npm or yarn package managers. ```Shell npm install payu-sdk ``` ```Shell yarn add payu-sdk ``` -------------------------------- ### Initializing Payu Node SDK in Node.js Source: https://github.com/payu-india/payu-sdk-node/blob/main/README.md Demonstrates how to initialize the Payu Node.js SDK by requiring the package and providing the Payu key and salt. It notes that the salt should be kept server-side and recommends using environment variables. ```JavaScript const payu = require('payu-sdk')({ key: '', salt: '', // should be on server side only }); ``` -------------------------------- ### Generating Hash with Payu Node SDK in Node.js Source: https://github.com/payu-india/payu-sdk-node/blob/main/README.md Shows how to use the payu.hasher.generateHash method to create a hash for a transaction, using required transaction details like ID, amount, product info, first name, and email. ```JavaScript const hash = payu.hasher.generateHash({ txnid: '20201223', amount: '1000', productinfo: 'iPhone', firstname: 'Ashish', email: 'ashish.25@mailinator.com', }); ``` -------------------------------- ### Validating Reverse Hash with Payu Node SDK in Node.js Source: https://github.com/payu-india/payu-sdk-node/blob/main/README.md Illustrates how to validate the hash received from Payu after a checkout process using the payu.hasher.validateHash method. It requires the received hash, transaction details, and the transaction status. ```JavaScript const reverseHash = '' // hash received after payment from payu const txnStatus = '' // 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, }) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.