This is a tutorial to integrate CCAvenue Payment gateway to your website. Please follow the steps carefully for proper integration.
- Active CCAvenue account.
– Merchant ID
– Access Code
– Secret or Encryption or Working Key
- Integration kit from CCAvenue website.
- Whitelist your domain/localhost
- Any text editor. (VS Code Editor Prefered)
1. Account & Domain
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.
2. Download Integration Kit
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
3. Choose the Integration Method
CCAvenue gives 3 different types of integration.
- Billing Page (Non-Seamless)
- iFrame Checkout
- Checkout Form
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.
4. Setting up the project
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.
5. Changes to be done in files
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.
6. Start the Node Server
From the root of the project, run the following command
node run_node.js which will run the node server from the file
7. Test the integration
Browse the URL: localhost:/about. You will be the following page.
Download the working integration kit
All the best 🙂 For any clarification please write your comments below..