How to integrate CCAvenue payment gateway into ASP.NET Razor website? (with steps & screenshots)

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
    1. Merchant ID
    2. Encryption Key
    3. Access Code
  3. CCAvenue Integration Kit for ASP.NET
  4. 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 Razor

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

2. Adding reference to the project

Download 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.

CCAvenue Reference

3. Adding Access Code, Encryption and Merchant ID

Add 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 environment

Open processor.cshtml and change form action as following,

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

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

CCAvenue Environment

5. Build & Run the project

i. 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

CCAvenue Checkout page

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