string processFlag = Request["processFlag"].ToString();
string txnType = Request["txnType"].ToString();
string orgTxnType = Request["orgTxnType"].ToString();
string amt = Request["amt"].ToString();
string orgExternalTraceNo = Request["orgExternalTraceNo"].ToString();
string terminalOperId = Request["terminalOperId"].ToString();
string terminalId = Request["terminalId"].ToString();
string authCode = Request["authCode"].ToString();
string RRN = Request["RRN"].ToString();
string shortPAN = Request["shortPAN"].ToString();
string responseCode = Request["responseCode"].ToString();
string responseMessage = Request["responseMessage"].ToString();
string cardType = Request["cardType"].ToString();
string issuerId = Request["issuerId"].ToString();
string issuerIdView = Request["issuerIdView"].ToString();
string signature = Request["signature"].ToString();
string externalTraceNo = Request["externalTraceNo"].ToString();
string merchantId = Request["merchantId"].ToString();
string txnTime = Request["txnTime"].ToString();
string val = "";
val = appendParam(val, processFlag);
val = appendParam(val, txnType);
val = appendParam(val, orgTxnType);
val = appendParam(val, amt);
val = appendParam(val, externalTraceNo);
val = appendParam(val, orgExternalTraceNo);
val = appendParam(val, terminalOperId);
val = appendParam(val, authCode);
val = appendParam(val, RRN);
val = appendParam(val, txnTime);
val = appendParam(val, shortPAN);
val = appendParam(val, responseCode);
val = appendParam(val, cardType);
val = appendParam(val, issuerId);
StreamWriter sw1 = File.AppendText(HttpContext.Current.Request.PhysicalApplicationPath + "\\test\\" + "\\myText1.txt");
sw1.WriteLine(val);
sw1.Flush();
sw1.Close();
if (CerRSAVerifySignature(val, signature, HttpContext.Current.Server.MapPath("~/mgw.cer")))
{
Response.Write("0");
StreamWriter sw = File.AppendText(HttpContext.Current.Request.PhysicalApplicationPath + "\\test\\" + "\\myText.txt");
sw.WriteLine(val);
sw.Flush();
sw.Close();
}
else
{
StreamWriter sw = File.AppendText(HttpContext.Current.Request.PhysicalApplicationPath + "\\test\\" + "\\myText.txt");
sw.WriteLine("s1s" + DateTime.Now.ToString());
sw.Flush();
sw.Close();
}
从Request获取各种参数,将参数写入val ,保存在myText1.txt文件中,判断是否有加密证书,然后分别处理。。