Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# ASP.NET Google Checkout Notification Acknowledgment

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());
like image 396
Luke Belbina Avatar asked Oct 12 '22 00:10

Luke Belbina


1 Answers

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;
like image 176
David Duffett Avatar answered Oct 14 '22 19:10

David Duffett