谷歌Checkout的通知确认失败 [英] Google checkout notification acknowledgment failing

查看:144
本文介绍了谷歌Checkout的通知确认失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个回调URL被调用,我可以处理它。然而 - 谷歌不处理我的确认。这是所有 EnvironmentType.Sandbox

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.

在谷歌Checkout的集成控制台我收到以下消息:

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.

和细节是:
他们给我发了什么:序列号= ...

他们收到什么:

<?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...

在code我使用的是:

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?

推荐答案

请参阅从<一个code这个背后code href=\"http://$c$c.google.com/p/google-checkout-dotnet-sample-$c$c/source/browse/examples/api25notification/Default.aspx.cs\"相对=nofollow>。网络图书馆的例子

如果您使用的是aspx文件,删除所有HTML内容在里面,如图 ASPX 同样的例子源

If you are using an aspx file, remove all the HTML content in it as shown in aspx source of the same example

到Response.End()也将工作,因为它会阻止返回任何进一步的内容效应初探(有效地做同样的事情 - prevents在HTML内容Web窗体被发送( ASPX 文件))。

Response.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 (aspx file) from being sent).

您也可以考虑使用一个通用处理器( ASHX ),而不是为你的回调URL的aspx页面。

You can also consider using a generic handler (ashx) instead of an aspx page for your callback url.

这篇关于谷歌Checkout的通知确认失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆