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 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 :)

Updated Post Here:

Aravind Appadurai