我正在尝试在ASP.Net MVC网站上集成PayTM付款网关。付款网关在本地服务器和测试服务器(托管在godaddy上)上运行正常,但在实时服务器(也托管在godaddy上)上无法正常运行。
生成校验和的代码是
Dictionary<String, String> paytmParams = new Dictionary<String, String>();
String merchantMid = "xxxxxx";
// Key in your staging and production MID available in your dashboard
String merchantKey = "xxxxxxx";
// Key in your staging and production merchant key available in your dashboard
String orderId = Guid.NewGuid().ToString();
String channelId = "WEB";
String mobileNo = "xxxxxx";
String email = "xxxxx";
String txnAmount = "500";
String website = "DEFAULT";
// This is the staging value. Production value is available in your dashboard
String industryTypeId = "Retail";
// This is the staging value. Production value is available in your dashboard
String callbackUrl = "https://xxxxxx/Home/PaymentResponse";
paytmParams.Add("MID", merchantMid);
paytmParams.Add("CHANNEL_ID", channelId);
paytmParams.Add("WEBSITE", website);
paytmParams.Add("CALLBACK_URL", callbackUrl);
paytmParams.Add("CUST_ID", custId);
paytmParams.Add("MOBILE_NO", mobileNo);
paytmParams.Add("EMAIL", email);
paytmParams.Add("ORDER_ID", orderId);
paytmParams.Add("INDUSTRY_TYPE_ID", industryTypeId);
paytmParams.Add("TXN_AMOUNT", txnAmount);
// for production
string transactionURL = "https://securegw.paytm.in/theia/processTransaction?orderid=" + orderId;
string paytmChecksum = paytm.CheckSum.generateCheckSum(merchantKey, paytmParams);
string outputHTML = "<html>";
outputHTML += "<head>";
outputHTML += "<title>Membership</title>";
outputHTML += "</head>";
outputHTML += "<body>";
outputHTML += "<center><h1>Please do not refresh this page...</h1></center>";
outputHTML += "<form method='post' action='" + transactionURL + "' name='f1'>";
foreach (string key in paytmParams.Keys)
{
outputHTML += "<input type='hidden' name='" + key + "' value='" + paytmParams[key] + "'>";
}
outputHTML += "<input type='hidden' name='CHECKSUMHASH' value='" + paytmChecksum + "'>";
outputHTML += "<script type='text/javascript'>";
outputHTML += "document.f1.submit();";
outputHTML += "</script>";
outputHTML += "</form>";
outputHTML += "</body>";
outputHTML += "</html>";
Response.Write(outputHTML);
金额从PayTM帐户中扣除,但是PayTM没有响应回调URL。从PayTM获取响应的代码是
Dictionary<string, string> parameters = new Dictionary<string, string>(); string paytmChecksum = "";
foreach (string key in Request.Form.Keys)
{ parameters.Add(key.Trim(), Request.Form[key].Trim()); }
这里回调URL正在打开,但是我得到0的Request.Form.Keys.Count计数。请指出我错了。