Node Module for integrating CCAvenue Payment gateway in Node.js
Before using this module, please make sure you have your merchant_id and working_key for test and production environment from CCAVenue payment gateway.
$ npm install node-ccavenue --save
$ yarn add node-ccavenue
Make sure your test / production workingKey and merchantId are stored as environment variables (best practice)
const nodeCCAvenue = ;const ccav =merchant_id: processenvmerchant_idworking_key: processenvtest_working_key || processenvprod_working_key;
You are free to use the encryption and decryption methods from the package. Which are exported as is.
const encryptedData = ccav;console; // Proceed further
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: 8765432currency: '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)
Feel free to open issues if you find any, or simply fork and create a pull request