【发布时间】:2011-06-24 16:35:51
【问题描述】:
我正在尝试在收到序列号后向 Google Checkout 发送通知确认,以便它知道我已经处理了此序列号并将其保存到我的数据库中。但我在集成控制台中不断收到以下错误:
我们遇到了错误处理 您的通知确认。这 我们得到的错误是:解析错误 通知确认。
当我检查发送到服务器的值时,我觉得一切都很好:
<notification-acknowledgement xmlns="http://checkout.google.com/schema/2" serial-number="357304636821412-00001-7" />
这是我的代码:
[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;
}
此外,为什么我一直只收到new-order-notification?对我来说更重要的是authorization-amount-notification,但它从不发送它,尽管在Documentation Section 2, Step 2.1 中它说一段时间后它应该向我发送这个通知。我在这里遗漏了什么吗?
【问题讨论】:
-
你试过 Response.Flush() 吗?
标签: api google-checkout