开发者

C# ASP.NET Google Checkout Notification Acknowledgment

开发者 https://www.devze.com 2023-03-06 09:55 出处:网络
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 he

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(R开发者_JAVA百科equest["serial-number"]);
 responseXml.Append("\" />");

 HttpResponse response = HttpContext.Current.Response;
 response.StatusCode = 200;
 response.ContentType = "text/xml";
 response.Write(responseXml.ToString());


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:

var ack = new GCheckout.AutoGen.NotificationAcknowledgment();
ack.serialnumber = serial;
Response.BinaryWrite(GCheckout.Util.EncodeHelper.Serialize(ack));
Response.StatusCode = 200;
0

精彩评论

暂无评论...
验证码 换一张
取 消