This is a tutorial to integrate CCAvenue Payment gateway to your website. Please follow the steps carefully for proper integration.
If you’re testing in your local environment, you must add your localhost to your CCAvenue account. Also, make sure the valid port number is provided to CCAvenue for whitelisting.
If your localhost URL is you
http://localhost:55181/ should have Access code & working key for this domain, not your main domain which you’re using for production. Many people use to forget this.
If you whitelisted localhost:1234 and if you’re using localhost:1235 or some other port number will not work. Please make sure testing URL matches with your CCAVenue details. Please find the screenshot below for more details.
Login into you CCAvenue account. Then go to Resources -> Web Integration Kit -> Download Integration kit & then choose “Download Node.js as shown in the image below.
Also, I have attached working copy of the Node.js integration kit here: CCAvenue-NodeJs-IntegrationKit
CCAvenue gives 3 different types of integration.
In our tutorial, we are going to use Billing page method. In backend almost these 3 methods are same but front-end behaviors will vary. You can find more details about this integration method in the ccavenue website.
Open the folder
nonseamless and open it in any of your favorite editors. I prefer VSCode.
Open the project path in command prompt in windows | bash in mac os.
Install the dependencies using the following command
npm install This command will install all the dependencies for the project to be up and running. You will find a new folder.
1. Open the file and
ccavRequestHandler.js replace with your working key and access code.
ccavResponseHandler.js – replace with your working key.
dataFrom.html – replace the merchant id & success and redirect URL to your localhost URL.
Thanks all, you are ready to collect payment on your website.
From the root of the project, run the following command
node run_node.js which will run the node server from the file
Browse the URL: localhost:/about. You will be the following page.
All the best 🙂 For any clarification please write your comments below..
Converting JSON toXML& XML to JSON in Node.js using xml2js package in TypeScript
npm install xml2js
npm install @types/xml2js --save-dev