Drupal Ubercart Google 结帐中的 SimpleXML 问题
我在我的 Drupal 6 网站中设置了 Ubercart 2.0,并为其功能启用了必要的模块,包括:购物车、商店、产品、订单、条件操作。
我已在测试模式(沙盒)下配置了 google checkout 模块,并相应地设置了商家 ID 和商家密钥值。
现在,当我将产品添加到购物车并单击 Google Checkout 时,我收到一条大错误消息:
致命错误:未捕获的异常 带有消息“字符串可以”的“异常” 不会被解析为 XML' C:\xampp\htdocs\drupal\sites\all\modules\ubercart\ payment\uc_google_checkout\uc_google_checkout.module:630 : SimpleXMLElement->__construct('') #1
似乎无法找出此错误的原因...
编辑:
在第 630 行,我有以下行:
$响应 = 新 SimpleXMLElement($response_obj->data);
我将 $response_obj->data 的值回显为:
https://sandbox.google.com/checkout/查看/购买?o=shoppingcart&shoppingcart=537534598601272
I have setup Ubercart 2.0 in my Drupal 6 website, and have enabled the necessary modules for its functionality, including: Cart, Store, Product, Order, Conditional Actions.
I have configured the google checkout module in test mode (Sandbox) and have put the Merchant ID and Merchant Key values accordingly.
Now when i added a product to the cart and clicked on Google Checkout, i got a big error message:
Fatal error: Uncaught exception
'Exception' with message 'String could
not be parsed as XML' in
C:\xampp\htdocs\drupal\sites\all\modules\ubercart\payment\uc_google_checkout\uc_google_checkout.module:630
: SimpleXMLElement->__construct('') #1
Cant seem to figure out the cause of this error...
EDIT:
On line 630, i have the following line:
$response = new
SimpleXMLElement($response_obj->data);
and i echoed the value of: $response_obj->data as:
https://sandbox.google.com/checkout/view/buy?o=shoppingcart&shoppingcart=537534598601272
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
想通了。当我调试我的代码时,我收到此错误:
“无法找到套接字传输“ssl” - 您在配置 PHP 时是否忘记启用它?”
然后经过一些研究,我发现我启用了 php_openssl.dll 扩展的 php.ini 文件不是 php 使用的文件。
因此,在正确的文件中启用它后,一切都很顺利。 :)
Figured it out. When i debugged my code, i got this error:
"Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?"
Then after some research, i found that the php.ini file where i enabled the php_openssl.dll extension is not the one that php is using.
So after enabling it in correct file, everything went smooth. :)