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

aravin.net_10002_error_code_this_happen_to_best_of_us

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.

Example

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

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

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

http://192.168.0.3:1234/

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: http://aravin.net/best-practices-ensure-transaction-integrity-ccavenue-payment-gateway/
  2. How to integrate CCAvenue in ASP.NET website: http://aravin.net/how-to-integration-ccavenue-payment-gateway-into-your-website-using-asp-net-with-screenshot/

Updated Post Here: http://aravin.net/complete-guide-integrate-ccavenue-payment-gateway-asp-net-website-screenshot/

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

  1. Riyaz Khan says:

    Hi Aravin,
    First of all I would like to inform you that I am your great fan of yours.
    Right now I am working on CCavenue payment gateway, I countionusly getting 10002 Authentication failed error, I am using PHP Kit file that is provided by CCAvenue to registered user only.
    – I have inserted Merchant ID, Access Code, Working key
    – Support team provide me this link URL:http://www.localhost:1530 to test on localhost.
    -I am using localhost with specific port 1530, then why I am getting this error ?

      • Riyaz says:

        You deserve sir…

        -Yes, It was provided by CCAvenue team. IT is http://www.localhost:1530 please watch it carefully it is followed by “www”, but they said that u can use it without www too, but we need to use it on same port which is 1530.
        – So I am running this script on http:/localhost:1530 url.
        – I am getting Error Code: 10002 Merchant Authentication failed. Don’t worry… It happens to the best of us.
        – All credentials have done there by me.

  2. T says:

    Hello Aravin,

    I have got my test account activated with CCAvenue. However now when I am trying to redirect to post url provided by them, I am getting Error Code: 115. Have been stuck with this for past couple of days.. No luck with google either 🙁
    Please help.

  3. sarang gadkari says:

    Hello Aravin,

    Do I need to activate localhost for testing purpose? even if i already have working key

  4. Nishant says:

    hello when i click on my checkout option i m facing a this”

    Error Code: 10001 Invalid Request – Encrypted request invalid/not present.

    Don’t worry… It happens to the best of us.
    ” can u tell me a solution of this problem ?

  5. Disha says:

    Hi Arvin,

    I follow your step from http://aravin.net/how-to-integration-ccavenue-payment-gateway-into-your-website-using-asp-net-with-screenshot/ this URL.

    Still I am getting following error:

    Error Code: 10001 Invalid Request – Encrypted request invalid/not present.

    Don’t worry… It happens to the best of us.

    Along with that I want to store “Error Code” in database
    whether it is success or failure with its code number.
    how can I do that.
    Thank You.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.