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";
- 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] + "&";
- }
-
- 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;
- WebRequest objRequest = WebRequest.Create(queryUrl);
- objRequest.Method = "POST";
-
- objRequest.ContentType = "application/x-www-form-urlencoded";
- myWriter = new System.IO.StreamWriter(objRequest.GetRequestStream());
- myWriter.Write(urlParam);
- myWriter.Close();
-
- System.Net.HttpWebResponse objResponse = (System.Net.HttpWebResponse)objRequest.GetResponse();
- 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