How to test CCAvenue Payment Gateway in localhost? (Avoid Error Code: 10002 Merchant Authentication failed)

In this tutorial, I am going to discuss how to test a CCAvenue payment gateway on your local system.

Why this tutorial?

  1. To test CCAvenue in localhost.
  2. To avoid issues on the Live website.

CCAvenue is one of the leading payment gateway providers in India, though their documentation is not up to the industry standard. It is hard to understand. While googling I found many peoples are getting 1002 Authentication Failed.

Reason for CCAvenue 10002 Authentication Failure

  • Wrong/invalid merchant ID
  • Wrong/invalid Working Key
  • Wrong/invalid access Key
  • URL of the registered website


But, that CCAvenue error message 10002 does not provide much information on which part it is failing because of security reason. However, many of them think that they are using wrong merchant id or access key or working key. But actual reason for this issue is URL of the account.


If you are registered for, your payment gateway will work only on, you cannot use it for any other website.

Also, you cannot use this API keys for your localhost such as http://localhost/ or

So, How to test CCAvenue in localhost or Testing Environment?

  1. Adding your localhost URL to CCAvenue Account
  2. Getting API Keys (Merchant ID, Access Code, Working key)
  3. Start Testing in localhost

1. Adding your localhost URL to CCAvenue Account

In order to add your localhost URL to CCAvenue account, you have to write an email to [email protected] from your registered email with required localhost URL.

Sample Localhost URL

2. Getting API Keys (Merchant ID, Access Code, Working key)

Once, your localhost or local IP address is added to your account, you can find the valid API keys in the following path

CCAvenue website -> Settings -> API Keys

Sample API Keys for localhostCCAvenue Account

3. Start Testing in localhost

Now, you can download your preferred programming language integration from the CCAvenue website & use the test API Keys.

That’s all 🙂

Quick Links

  1. CCAvenue Best Practice:
  2. How to integrate CCAvenue in ASP.NET website:

Updated Post Here:

How to integrate CCAvenue payment gateway into your website using ASP.NET? (with Screenshot)

Today, I am going to write about CCAvenuge Payment Gateway integration into your own website. Let’s go!

Your Pre-requisites

  • CCAvenue accounts with Activation.
    – Merchant ID
    – Access Code
    – Secret or Encryption or Working Key
  • Integration kit from CCAvenue website.
  • Visual Studio 2012 or Later

Steps to Integration

1. Downloading Integration Kit

Login into you CCAvenue account. Then go to Resources -> Web Integration Kit -> Download Integration kit & then choose “Download ASP.NET (V3.5) as show in image below. Also, I have attached download link of ASP.NET integration kit here: ASP.Net_Kit_Version_3.5.
CCAvenue Integration

2. 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 theses 3 methods are same but front-end behaviours will vary. You can find more details about this integration method in ccavenue website.

3. Opening Project in Visual Studio

Extract the file downloaded in step 1, it will 3 folders. Go to folder NON_SEAMLESS_KIT and open the file using Visual Studio
CCAvenue Payment Gateway Integration

4. Adding Access Code, Encryption Key and Merchant ID into Project

1. Open the file named ccavRequestHandler.aspx and provide Access Code and Encryption Key as shown in below.
CCAvenue Payment Gateway Integration

2. Open the file ccavResponseHandler.aspx and provide Encryption Key.

3. Open the file dataFrom.htm and provide Merchant Key as shown in the image below.
CCAvenue Payment Gateway Integration

5. Adding Reference to the Project (Most Important)

i. Right click on “Reference” to the solution explorer in Visual Studio.
Adding Reference in Visual Studio

ii. Browse for the MCPG.CCA.Util.dll and add it to project reference.
Adding DLL into Visual Studio

6. Build the Project

i. Clean the project.
ii. Build the project.

Then go to the project folder -> Obj -> Release folder, you will find recently generated

7. Run the Project

That’s all! Run the project. You will get dataFrom.htm
ccavenue payment gateway integration

If you followed all these steps as mentioned, you will redirect to ccavenue website while clicking on `checkout` button.
ccavenue payment gateway integration

If you have any queries/concern, please drop in the comment section below.

Quick Info

Updated Post Here:

  1. Complete List of CCAvenue Error Codes with reason
  2. Complete list of CCAvenue Response code with description
  3. How to integrate CCAvenue payment gateway into ASP.NET Razor website?