无法使用NotificationApi从google checkout获取通知

发布于 2024-12-09 03:44:13 字数 6926 浏览 0 评论 0原文

我正在尝试使用通知 Api 实现 google checkout,因为我想获取订单信息并将其存储在我自己的数据库中。 Google Checkout 已实施,订单已下达且付款已完成,但我无法从 Google Checkout 获取通知。 我已尝试了 Google Checkout 商家帐户中所述的所有设置 http://surinder.computing-studio.com/ 并完成了上面文章中列出的代码,但仍然无法收到通知。 我在商家帐户的集成控制台中收到的错误是:

我们在尝试访问您的服务器时遇到错误 http://www.techieticket.co.uk/Notifications.aspx——我们得到的错误是

Send failed with code: 500. Response body was: <html>  <head>  <title>Data at the root level is invalid. Line 1, position 1.</title>  <style>  body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style>  </head>  <body bgcolor="white">  <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>  <h2> <i>Data at the root level is invalid. Line 1, position 1.</i> </h2></span>  <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">  <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br><br>  <b> Exception Details: </b>System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.<br><br>  <b>Source Error:</b> <br><br>  <table width=100% bgcolor="#ffffcc">  <tr>  <td>  <code><pre> Line 14: RequestStream.Close(); Line 15: // Act on the XML. <font color=red>Line 16: switch (EncodeHelper.GetTopElement(RequestXml)) { </font>Line 17: case &quot;new-order-notification&quot;: Line 18: NewOrderNotification N1 = (NewOrderNotification) EncodeHelper.Deserialize(RequestXml, typeof(NewOrderNotification));</pre></code>  </td>  </tr>  </table>  <br>  <b> Source File: </b> d:\Sites\tech2\Notifications.aspx<b> &nbsp;&nbsp; Line: </b> 16 <br><br>  <b>Stack Trace:</b> <br><br>  <table width=100% bgcolor="#ffffcc">  <tr>  <td>  <code><pre> [XmlException: Data at the root level is invalid. Line 1, position 1.] System.Xml.XmlTextReaderImpl.Throw(Exception e) +76 System.Xml.XmlTextReaderImpl.Throw(String res, String arg) +126 System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() +3975494 System.Xml.XmlTextReaderImpl.ParseDocumentContent() +187 System.Xml.XmlTextReaderImpl.Read() +151 System.Xml.XmlTextReader.Read() +15 GCheckout.Util.EncodeHelper.GetTopElement(Stream Xml) in C:\Work\googlecode\gcheckout\lib\Util\EncodeHelper.cs:148 GCheckout.Util.EncodeHelper.GetTopElement(Byte[] Xml) in C:\Work\googlecode\gcheckout\lib\Util\EncodeHelper.cs:88 GCheckout.Util.EncodeHelper.GetTopElement(String Xml) in C:\Work\googlecode\gcheckout\lib\Util\EncodeHelper.cs:114 ASP.notifications_aspx.Page_Load(Object sender, EventArgs e) in d:\Sites\tech2\Notifications.aspx:16 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 </pre></code>  </td>  </tr>  </table>  <br>  <hr width=100% size=1 color=silver>  <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.5053 </font>  </body> </html> <!-- [XmlException]: Data at the root level is invalid. Line 1, position 1. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlTextReader.Read() at GCheckout.Util.EncodeHelper.GetTopElement(Stream Xml) in C:\Work\googlecode\gcheckout\lib\Util\EncodeHelper.cs:line 148 at GCheckout.Util.EncodeHelper.GetTopElement(Byte[] Xml) in C:\Work\googlecode\gcheckout\lib\Util\EncodeHelper.cs:line 88 at GCheckout.Util.EncodeHelper.GetTopElement(String Xml) in C:\Work\googlecode\gcheckout\lib\Util\EncodeHelper.cs:line 114 at ASP.notifications_aspx.Page_Load(Object sender, EventArgs e) in d:\Sites\tech2\Notifications.aspx:line 16 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.notifications_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d4056d14\8cf5e5c6\App_Web_sascrtij.0.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->

I am trying to implement google checkout with Notifications Api as i want to get and store the order information in my own database. Google checkout is implemented, order gets placed and payment is done but i am unable to get the notifications from google checkout.
I have tried all the settings in Google Checkout's Merchant account stated in
http://surinder.computing-studio.com/
and done code as listed in the above article but still unable to get the notifications.
The error i get in intergration console of my Merchant account is :

We encountered an error trying to access your server at http://www.techieticket.co.uk/Notifications.aspx -- the error we got is

Send failed with code: 500. Response body was: <html>  <head>  <title>Data at the root level is invalid. Line 1, position 1.</title>  <style>  body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style>  </head>  <body bgcolor="white">  <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>  <h2> <i>Data at the root level is invalid. Line 1, position 1.</i> </h2></span>  <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">  <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br><br>  <b> Exception Details: </b>System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.<br><br>  <b>Source Error:</b> <br><br>  <table width=100% bgcolor="#ffffcc">  <tr>  <td>  <code><pre> Line 14: RequestStream.Close(); Line 15: // Act on the XML. <font color=red>Line 16: switch (EncodeHelper.GetTopElement(RequestXml)) { </font>Line 17: case "new-order-notification": Line 18: NewOrderNotification N1 = (NewOrderNotification) EncodeHelper.Deserialize(RequestXml, typeof(NewOrderNotification));</pre></code>  </td>  </tr>  </table>  <br>  <b> Source File: </b> d:\Sites\tech2\Notifications.aspx<b>    Line: </b> 16 <br><br>  <b>Stack Trace:</b> <br><br>  <table width=100% bgcolor="#ffffcc">  <tr>  <td>  <code><pre> [XmlException: Data at the root level is invalid. Line 1, position 1.] System.Xml.XmlTextReaderImpl.Throw(Exception e) +76 System.Xml.XmlTextReaderImpl.Throw(String res, String arg) +126 System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() +3975494 System.Xml.XmlTextReaderImpl.ParseDocumentContent() +187 System.Xml.XmlTextReaderImpl.Read() +151 System.Xml.XmlTextReader.Read() +15 GCheckout.Util.EncodeHelper.GetTopElement(Stream Xml) in C:\Work\googlecode\gcheckout\lib\Util\EncodeHelper.cs:148 GCheckout.Util.EncodeHelper.GetTopElement(Byte[] Xml) in C:\Work\googlecode\gcheckout\lib\Util\EncodeHelper.cs:88 GCheckout.Util.EncodeHelper.GetTopElement(String Xml) in C:\Work\googlecode\gcheckout\lib\Util\EncodeHelper.cs:114 ASP.notifications_aspx.Page_Load(Object sender, EventArgs e) in d:\Sites\tech2\Notifications.aspx:16 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 </pre></code>  </td>  </tr>  </table>  <br>  <hr width=100% size=1 color=silver>  <b>Version Information:</b> Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.5053 </font>  </body> </html> <!-- [XmlException]: Data at the root level is invalid. Line 1, position 1. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlTextReader.Read() at GCheckout.Util.EncodeHelper.GetTopElement(Stream Xml) in C:\Work\googlecode\gcheckout\lib\Util\EncodeHelper.cs:line 148 at GCheckout.Util.EncodeHelper.GetTopElement(Byte[] Xml) in C:\Work\googlecode\gcheckout\lib\Util\EncodeHelper.cs:line 88 at GCheckout.Util.EncodeHelper.GetTopElement(String Xml) in C:\Work\googlecode\gcheckout\lib\Util\EncodeHelper.cs:line 114 at ASP.notifications_aspx.Page_Load(Object sender, EventArgs e) in d:\Sites\tech2\Notifications.aspx:line 16 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.notifications_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d4056d14\8cf5e5c6\App_Web_sascrtij.0.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --><!-- This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苍景流年 2024-12-16 03:44:13

集成控制台中的错误表明您的服务器未正确确认通知:

http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Notification_API.html#responding_to_notifications

要尝试的一些操作:

  1. 验证您是否正确解析通知并正确发送返回确认。

  2. 验证 XML 响应的格式是否正确。与 HTML 不同,XML 解析器对空格、小写与大写以及一般的正确语法很挑剔。

The error in the Integration Console sugges that your server is not correctly acknowledging the notification:

http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Notification_API.html#responding_to_notifications

Some things to try:

  1. Verify that you are correctly parsing the notification and correctly sending back the acknowledgement.

  2. Verify that the XML response is correctly formated. Unlike HTML, XML parsers are picky about whitespaces, lower vs upper-case, proper syntax in general.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文