C# ASP.NET Google Checkout 通知确认
我已经为此工作了一段时间,但无法让谷歌接受我已经完成了他们想要的事情,因此他们不断向我发送同一订单的通知。此处提供了相关文档:
此处是我在接收谷歌通知的页面上的代码:
string serial = Request["serial-number"];
// do my stuff
StringBuilder responseXml = new StringBuilder();
responseXml.Append("<?xml version='1.0' encoding='UTF-8'?>");
responseXml.Append("<notifiation-acknowledgment xmlns=\"http://checkout.google.com/schema/2/\" serial-number=\"");
responseXml.Append(Request["serial-number"]);
responseXml.Append("\" />");
HttpResponse response = HttpContext.Current.Response;
response.StatusCode = 200;
response.ContentType = "text/xml";
response.Write(responseXml.ToString());
Been working on this for a while and just can't get google to accept that I've done what they want so they keep sending me notifications for the same order. The documentation on this is available here:
Google Notification Acknowledgement Documentation
Here is my code on the page which recieves google notifcations:
string serial = Request["serial-number"];
// do my stuff
StringBuilder responseXml = new StringBuilder();
responseXml.Append("<?xml version='1.0' encoding='UTF-8'?>");
responseXml.Append("<notifiation-acknowledgment xmlns=\"http://checkout.google.com/schema/2/\" serial-number=\"");
responseXml.Append(Request["serial-number"]);
responseXml.Append("\" />");
HttpResponse response = HttpContext.Current.Response;
response.StatusCode = 200;
response.ContentType = "text/xml";
response.Write(responseXml.ToString());
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将“通知-确认”错误地拼写为“通知-确认”。
我还建议使用 GCheckout 正如briercan在评论中所说。如果你使用它,那么你所要做的就是:
You have misspelt "notification-acknowledgment" as "notifiation-acknowledgment".
I would also suggest using GCheckout as briercan said in the comments. If you use that, then all you would have to do is: