Node CCAvenue
Node Module for integrating CCAvenue Payment gateway in Node.js
Prerequisite
Before using this module, please make sure you have your merchant_id and working_key for test and production environment from CCAVenue payment gateway.
Installation
$ npm install node-ccavenue --save
or
$ yarn add node-ccavenue
Initialization
Make sure your test / production workingKey and merchantId are stored as environment variables (best practice)
const nodeCCAvenue = ;const ccav = merchant_id: processenvmerchant_id working_key: processenvtest_working_key || processenvprod_working_key;
Usage
You are free to use the encryption and decryption methods from the package. Which are exported as is.
Encryption
const encryptedData = ccav;console; // Proceed further
Decryption
const decryptedData = ccav;console; // Proceed further
Creating encrypted text for generating an order
No need to use the encrypt function in this case.
const orderParams = order_id: 8765432 currency: 'INR' amount: '100' redirect_url: billing_name: 'Name of the customer' // etc etc; const encryptedOrderData = ccav;console; // Proceed further
Decrypting the response from CCAvenue to a JSON output
// Considering this is your redirect_urlrouter;
Sample JSON Response from CCAvenue
This is the json response output after passing the encrypted request to redirectResponseToJson(encResp)
Contributing
Feel free to open issues if you find any, or simply fork and create a pull request