我们有一家服务提供商,允许我们连接到他的付款页面,但是他使用的代码是php,但我们希望在asp.net中完成。POST或GET方法?
问题是,我真的不明白的方法应该是什么,POST
或GET
,基本上我们需要重定向到与潜在的参数(不查询字符串),然后我们当前页面的客户端调用请求必须被重定向带有参数的客户端页面。
我确实得到的反应巫婆基本上是标记,但这不是我想要的,我希望它重定向到付款页面,有人可以告诉我我做错了什么。谢谢 这是我用的代码在POST
方法:
string query = string.Format("description={0}&amount={1}&merchantIdent={2}&email={3}&transaction={4}&merchantKey={5}",
description.ToString(), amount.ToString(), merchantIdent.ToString(), email.ToString(), id.ToString(), merchantKey.ToString());
// Create the request back
string url = "https://www.webcash.co.za/pay";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "POST";
req.AllowAutoRedirect = true;
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = query.Length;
req.AllowAutoRedirect = true;
StreamWriter stOut = new StreamWriter(req.GetRequestStream(),System.Text.Encoding.ASCII);
stOut.Write(query);
stOut.Close();
// Do the request
StreamReader stIn = new StreamReader(req.GetResponse().GetResponseStream());
string response = stIn.ReadToEnd();
stIn.Close();
您可能不会在这里提出正确的问题......当提交给您的银行的增值税时,您将被困在一个ASPNET表格中,该表格会回传给自己...不确定,但我是否正确这个? – IrishChieftain