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.
- Visual Studio 2012 or Latest
- CCAvenue Active account with
- Merchant ID
- Encryption Key
- Access Code
- CCAvenue Integration Kit for ASP.NET
- 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.
3. Adding Access Code, Encryption and Merchant ID
Add Working key and Merchant ID to index.cshml file.
Search for Snippetstring 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 Snippetvar workingKey = "add_your_32_bit_working_key_here";
and Snippetvar strAccessCode = "add_your_access_key_here";
Replace with your working key and access key.
4. Set Test/Production environment
processor.cshtml and change form action as following,
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
Once you filled out this form, you will redirect to CCAvenue checkout page. Kindly drop your concern/issues/suggestion in below comment section.