Luke Belbina
Luke Belbina

Reputation: 5869

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());

Upvotes: 5

Views: 852

Answers (1)

David Duffett
David Duffett

Reputation: 3155

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;

Upvotes: 4

Related Questions