I have a callback url that gets called, and I can process it. However – Google doesn’t process my acknowledgment. This is all in EnvironmentType.Sandbox.
In the Google checkout “Integration Console” I get the following message:
We encountered an error processing your notification acknowledgment.
The error we got is: Error parsing notification acknowledgment.
And the details are:
What they sent me: serial-number=....
What they received:
<?xml version="1.0" encoding="utf-8"?>
<notification-acknowledgment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" serial-number="here is the same serial number they sent me" xmlns="http://checkout.google.com/schema/2" />
<!DOCTYPE html...
The code I’m using:
GCheckout.AutoGen.NotificationAcknowledgment response = new GCheckout.AutoGen.NotificationAcknowledgment();
response.serialnumber = serialNumber;
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.BinaryWrite(GCheckout.Util.EncodeHelper.Serialize(response));
HttpContext.Current.Response.StatusCode = 200;
What’s the mistake here?
See this “code behind” code from the .Net Library examples
If you are using an aspx file, remove all the HTML content in it as shown in
aspxsource of the same exampleResponse.End()will also work because it stops any further Reponse content from being returned (effectively does the same thing – prevents the HTML content in the Web Forms (aspxfile) from being sent).You can also consider using a generic handler (
ashx) instead of an aspx page for your callback url.