使用 ASP.net 的 Google Checkout HTTP Post
我有 2 个在 ASP.net(C#) 中创建的页面。第一个(称为 Shoppingcart.asp)有一个“立即购买”按钮。第二个(称为 processpay.asp)只是等待 google checkout 向其发送 HTTP 请求来处理付款。我想要做的是向 google checkout 发送一个 post 语句,其中包含几个我想要传递回 processpay.asp 的变量(即 clientid=3&itemid=10),但我不知道如何格式化 POST HTTP声明或我必须在 google checkout 中更改哪些设置才能使其正常工作。
任何想法将不胜感激。
I have 2 pages I created in ASP.net(C#). The first one(called shoppingcart.asp) has a buy it now button. The second one(called processpay.asp) just waits for google checkout to send an HTTP request to it to process the payment. What I would like to do send a post statement to google checkout with a couple of variables that I want passed back to processpay.asp(ie clientid=3&itemid=10), but I don't know how to format the POST HTTP statement or what settings I have to change in google checkout to make it work.
Any ideas would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Google Checkout 提供了示例代码以及有关如何将其与任何 .NET 应用程序集成的教程:
请务必检查标题为“将示例代码集成到您的网络应用程序中"。
但是,如果您更喜欢使用服务器端 POST,则可能需要检查以下方法,该方法提交 HTTP post 并以字符串形式返回响应:
参数需要以以下形式传递:
name1=value1&名称2=值2
Google Checkout has sample code and a tutorial on how to integrate it with any .NET application:
Make sure to check the section titled: "Integrating the Sample Code into your Web Application".
However, if you prefer to use a server-side POST, you may want to check the following method which submits an HTTP post and returns the response as a string:
Parameters need to be passed in the form:
name1=value1&name2=value2
代码最终可能看起来像这样:
The code will likely end up looking something like this:
昨天我使用了 http://www.codeproject.com/KB/aspnet/ASP_NETRedirectAndPost.aspx< /a> 发送帖子数据并且工作正常
Yesterday I used http://www.codeproject.com/KB/aspnet/ASP_NETRedirectAndPost.aspx to send the post data and it works fine