Complete guide to integrate CCAvenue Payment gateway into ASP.NET website – with Screenshot

About this tutorial

This is an end-to-end guide to integrating a CCAvenue payment gateway into ASP.NET web application using official kit. Starting from account setup to successful payment.

Pre-Requirement

  1. Visual Studio
  2. Active CCAvenue account
    1. Merchant ID
    2. Access Code
    3. Working Key
  3. Official CCAvenue kit
  4. Little knowledge about C# & ASP.NET

Setting up your CCAvenue account for localhost

In order to run your CCAvenuepayment gateway in localhost, we need to add our localhost into CCAvenue account. You have to write an email to [email protected] and ask him to add your localhost.  Kindly refer screenshot below for more details.

Example: http://localhost:55181/

Screenshot 1

Download Integration Kit from CCAvenue website

Integration kit will be available on http://ccavenue.com → Resources → Web Integration Kit → Download Integration Kit → Download ASP.NET 3.5

Also, you can download from here: ASP.Net_Kit_Version_3.5

Extract the Integration Kit

Open the Project in Visual Studio

  1. Open Visual Studio
  2. Choose Open → Project/Solution from the file menu.

3. Browse to the downloaded Integration kit. Open the NON-SEAMLESS KIT

4. Open MCPG.ASP.net.ENC

Add Reference to the project [Very Important]

Many people used to face an issue in this stage. But it is really an easy step. Kindly follow the screenshot.

Right-click the References in solution explorer → Add Reference

Note: Reference DLL file will be available in downloaded integration kit itself.

Browse the downloaded folder

  1. bin → MCPG.ASP.net.ENC.dll & add it to the project.
  2. lib → MCPG.CCA.Util.dll & add it to project.

Note: REMOVE existing dll, if any. You have to add fresh dll.

Add localhost to the project

This step is mandatory to run the CCAvenue setup in local system i.e in a development system. If you didn’t ask localhost, this setup won’t work because by default asp.net project will point to some default IP like http://127.0.0.1/

So, better add your localhost i.e In my case it is which http://localhost:55181/ is same as in my CCAvenue Account, which we have added in step 1.

Right click project → Properties

Change Merchant ID, Acess Code and Working Key in our application

Pages to be modified:-

  1. ccavRequestHandler.aspx.cs
  2. ccavResponseHandler.aspx.cs
  3. dataFrom.htm

Change workingKey and strAccessCode in ccavRequestHandler.aspx.cs

Change workingKey again in  ccavResponseHandler.aspx.cs

Change merchant_id, redirect_url, cancel_url – VERY IMPORTANT

Great 🙂 If you followed all the step, you can build & run

Choose between Testing/Live environment

You can choose Testing or Live environment from the ccavRequestHandler.aspx

For Live Environment 

https://secure.ccavenue.com/transaction/transaction.do?command=initiateTransaction

For Testing Environment

https://test.ccavenue.com/transaction/transaction.do?command=initiateTransaction

Making Payment in Live (Production) Environment

Run the application, you will see the following account.

Fill the details & Proceed to checkout

Choose the preferred payment gateway from Credit Card/Debit Card/Net Baking etc..

Enter the required details and click on make payment

Finally, Complete the payment 🙂

That’s all 🙂 You can push your code to Live Website 🙂

I tried my best to cover all the steps in screenshot & steps. If I missed any steps, kindly drop the queries in a comment section.

Also, for any clarification or doubt, please write back to me on comment section. I will try to reply as soon as possible.

13 thoughts on “Complete guide to integrate CCAvenue Payment gateway into ASP.NET website – with Screenshot

  1. Arvind says:

    I have download ASP.Net_Kit_Version_3.5 from above link and implemented on local system, but i have developed website using asp.net c# which already have about 50 pages. and your code is window code. how can i upload/run both files on server.

  2. Arvind says:

    Hi, I mean that i already running a dynamic website on server using asp.net c#, i want to upload seamless project how should i do. pls suggest.

  3. Tridib Mukherjee says:

    Hi, Can you please share this integration in ASP.NET with VB. My site has developed using vb. so i need this integration kit in vb. Please share.

  4. Sunil Kumar Singh says:

    I am getting below error.
    Error Code: 10002 Merchant Authentication failed.

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

  5. Amarnath says:

    Hi there is field Promo Code, how to use it, the discount was given by CcAvenue or Marchant.
    If Marchant gives the discount to there customers, so in coding detect the money as how much discount was given by Marchant from a Actual Amount and pass the amount or just pass the Actual Amount and Promo Code and then auto detect the discount amount from actual Amount. Can you describe the promo code field.

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.