I'm trying to send Google Checkout a Notification Acknowledgement once I receive a serial number so it would know that I've already handled this serial number and saved it to my database. But I keep getting the following error in the integration console:
We encountered an error processing your notification acknowledgment. The error we got is: Error parsing notification acknowledgment.
When I check the value being sent to the server, everything seems to look fine to me:
<notification-acknowledgement xmlns="http://checkout.google.com/schema/2" serial-number="357304636821412-00001-7" />
Here's my code:
[HttpPost]
public EmptyResult Notify()
{
var serial = Request["serial-number"];
var data =
"<notification-history-request xmlns=\"http://checkout.google.com/schema/2\"><serial-number>" + serial + "</serial-number></notification-history-request>";
var serverResponse = _checkoutService.Post(data, GoogleCheckoutConstants.ReportsUri);
//Send me email to checkout the response
dynamic email = new Email("CheckoutLog");
email.Response = serverResponse;
email.Send();
var acknowldgement =
"<notification-acknowledgement xmlns=\"http://checkout.google.com/schema/2\" serial-number=\"" + serial +
"\" />";
HttpResponse response = System.Web.HttpContext.Current.Response;
response.StatusCode = 200;
response.ContentType = "text/xml";
response.Write(acknowldgement);
return null;
}
Moreover, why do I keep receiving new-order-notification
only? What's more important to me is the authorization-amount-notification
, but it never sends it although in the Documentation Section 2, Step 2.1 it says that after some time it should send me this notification. Am I missing something here?