Hi All, this tutorial is about CCAvenue payment gateway integration for ASP.NET Razor website (.CSHTML). If you are using ASP.NET web pages (.ASPX) you can check the tutorial here.

Pre-Requisites

  1. Visual Studio 2012 or Latest
  2. CCAvenue Active account with
  3. Merchant ID
  4. Encryption Key
  5. Access Code
  6. CCAvenue Integration Kit for ASP.NET
  7. Custom ASP.NET Integration Kit for Razor (Download here: ccavenue_aspnet_razor_kit_1)

Steps for Integration

1. Download Custom ASP.NET Integration Kit for RazorDownload the ASP.NET Integration Kit for Razor from the above link and import into your project. [Download Now]

2. Adding reference to the projectDownload the CCAvenue Integration kit and add Right click on your visual studio project -> Add -> Reference and choose the reference file MCPG.CCA.Util.dll and import it into the visual studio project.

cca_reference-1.png

3. Adding Access Code, Encryption and Merchant IDAdd Working key and Merchant ID to index.cshml file.

Search for Snippet

string workingKey = "add_your_32_bit_working_key_here"; 

Replace with your 32 secret key given from CCAvenue

Add Working Key, Access Code to processor.chtml file.

Search for Snippet

var workingKey = "add_your_32_bit_working_key_here"; 

and Snippet

var strAccessCode = "add_your_access_key_here"; 

Replace with your working key and access key.

4. Set Test/Production environmentOpen processor.cshtml and change form action as following,

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

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

cca_environment-1.jpeg

5. Build & Run the projecti. Clean the project.

ii. Build the Project.

iii. Run the Project.


That's all :)

if you did all the steps as mentioned, you will get the website as shown below

cca_checkout_page-1.jpeg

Once you filled out this form, you will redirect to CCAvenue checkout page. Kindly drop your concern/issues/suggestion in below comment section.


Aravind Appadurai

Aravin