Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
.NET
.NET Core
.NET MAUI
.NET Standard
Active Directory
ADO.NET
Agile Development
AI
AJAX
AlbertAGPT
Alchemy
Alexa Skills
Algorand
Algorithms in C#
Android
Angular
ArcObject
ASP.NET
ASP.NET Core
Augmented Reality
Avalanche
AWS
Azure
Backbonejs
Big Data
BizTalk Server
Blazor
Blockchain
Bootstrap
Bot Framework
Business
Business Intelligence(BI)
C#
C# Corner
C# Strings
C, C++, MFC
Career Advice
Careers and Jobs
Chapters
ChatGPT
Cloud
Coding Best Practices
Cognitive Services
COM Interop
Compact Framework
Copilot
Cortana Development
Cosmos DB
Cryptocurrency
Cryptography
Crystal Reports
CSS
Current Affairs
Custom Controls
Cyber Security
Data Mining
Data Science
Databases & DBA
Databricks
Design Patterns & Practices
DevExpress
DevOps
DirectX
Dynamics CRM
Enterprise Development
Entity Framework
Error Zone
Exception Handling
F#
Files, Directory, IO
Flutter
Games Programming
GDI+
General
Generative AI
GO
Google Cloud
Google Development
Graphics Design
Graphite Studio
Hardware
Hiring and Recruitment
HoloLens
How do I
HTML 5
Infragistics
Internet & Web
Internet of Things
Ionic
Java
Java and .NET
JavaScript
JQuery
JSON
JSP
Knockout
Kotlin
Langchain
Leadership
Learn .NET
Learn iOS Programming
LINQ
Machine Learning
Metaverse
Microsoft 365
Microsoft Fabric
Microsoft Office
Microsoft Phone
Microsoft Teams
Mobile Development
MongoDB
MuleSoft
MySQL
NEAR
NetBeans
Networking
NFT
NoCode LowCode
Node.js
Office Development
OOP/OOD
Open Source
Operating Systems
Oracle
Outsourcing
Philosophy
PHP
Polygon
PostgreSQL
Power Apps
Power Automate
Power BI
Power Pages
Printing in C#
Products
Progress
Progressive Web Apps
Project Management
Public Speaking
Python
Q#
QlikView
Quantum Computing
R
React
React Native
Reports using C#
Robotics & Hardware
RPA
Ruby on Rails
RUST
Salesforce
Security
Servers
ServiceNow
SharePoint
Sharp Economy
SignalR
Smart Devices
Snowflake
Software Architecture/Engineering
Software Testing
Solana
Solidity
Sports
SQL
SQL Server
Startups
Stratis Blockchain
Swift
SyncFusion
Threading
Tools
TypeScript
Unity
UWP
Visual Basic .NET
Visual Studio
Vue.js
WCF
Wearables
Web API
Web Design
Web Development
Web3
Windows
Windows Controls
Windows Forms
Windows PowerShell
Windows Services
Workflow Foundation
WPF
Xamarin
XAML
XML
XNA
XSharp
Register
Login
0
Answer
Integrate CCAvenanu Payment Gateway to Dot net core api 2.0?
Harish Batchu
5y
4.8k
1
Reply
HI folks,
I would like to integrate ccavenue payment gateway to andriod application. For request and response processing we are using backend dot net core web api 2.1. But I did't find any reference for dot net core application. Can any one help me out to get out of this.
I will add the code what they are give for request and respose processing files.
using
System;
using
System.Collections.Generic;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Collections;
using
System.Collections.Specialized;
using
CCA.Util;
public
partial
class
ResponseHandler : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
string
workingKey =
"6D108E9180E34A8B9FA6350B59108071"
;
//put in the 32bit alpha numeric key in the quotes provided here
CCACrypto ccaCrypto =
new
CCACrypto();
string
encResponse = ccaCrypto.Decrypt(Request.Form[
"encResp"
],workingKey);
NameValueCollection Params =
new
NameValueCollection();
string
[] segments = encResponse.Split(
'&'
);
foreach
(
string
seg
in
segments)
{
string
[] parts = seg.Split(
'='
);
if
(parts.Length > 0)
{
string
Key = parts[0].Trim();
string
Value = parts[1].Trim();
Params.Add(Key, Value);
}
}
for
(
int
i = 0; i < Params.Count; i++)
{
Response.Write(Params.Keys[i] +
" = "
+ Params[i] +
"<br>"
);
}
}
}
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Net;
using
System.IO;
using
CCA.Util;
using
System.Collections.Specialized;
using
System.Xml;
namespace
GetRSA_Kit
{
public
partial
class
GetRSA : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
try
{
string
queryUrl =
"https://secure.ccavenue.com/transaction/getRSAKey"
;
string
vParams =
""
;
foreach
(
string
key
in
Request.Params.AllKeys){
vParams += key +
"="
+ Request[key] +
"&"
;
}
// Url Connection
String message = postPaymentRequestToGateway(queryUrl, vParams);
Response.Write(message);
}
catch
(Exception exp){
Response.Write(
"Exception "
+ exp);
}
}
private
string
postPaymentRequestToGateway(String queryUrl, String urlParam)
{
String message =
""
;
try
{
StreamWriter myWriter =
null
;
// it will open a http connection with provided url
WebRequest objRequest = WebRequest.Create(queryUrl);
//send data using objxmlhttp object
objRequest.Method =
"POST"
;
//objRequest.ContentLength = TranRequest.Length;
objRequest.ContentType =
"application/x-www-form-urlencoded"
;
//to set content type
myWriter =
new
System.IO.StreamWriter(objRequest.GetRequestStream());
myWriter.Write(urlParam);
//send data
myWriter.Close();
//closed the myWriter object
// Getting Response
System.Net.HttpWebResponse objResponse = (System.Net.HttpWebResponse)objRequest.GetResponse();
//receive the responce from objxmlhttp object
using
(System.IO.StreamReader sr =
new
System.IO.StreamReader(objResponse.GetResponseStream()))
{
message = sr.ReadToEnd();
}
}
catch
(Exception exception)
{
Console.Write(
"Exception occured while connection."
+ exception);
}
return
message;
}
}
}
Thanks in advance
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
C# MVC Visual Studio 2015
custom validator is not firing on the server side code