Magento 1.6 FedEx 无报价
您可能知道,Magento 中有 FedEx Web 服务 API。但我仍然无法让它发挥作用。 在 Magento 的管理端输入所有内容(密码、帐户 ID、密钥等)。 还在得到
此运送方式目前不可用。如果您想使用此运送方式运送,请联系我们。
试图了解 code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php 中发生的情况 发送 SOAP 请求时,第 ~360 行:
$requestString = serialize($ratesRequest);
$response = $this->_getCachedQuotes($requestString);
捕获 $requestString
和 $response
。 $response
始终为空(print_r 给出空字符串),还尝试在管理端设置“沙盒模式”是和否。 $requestString
是:
a:4:{s:23:"WebAuthenticationDetail";a:1:{s:14:"UserCredential";a:2:{s:3:"Key";s:16:"KEY";s:8:"密码";s:6:" PASSWD";}}s:12:"客户详细信息";a:2:{s:13:"帐号";s:9:"ACCNUMBER";s:11:"仪表编号";s:9:"仪表NUMBER";}s:7:"版本";a:4:{s:9:"ServiceId";s:3:"crs";s:5:"主要";s:1:" 9";s:12:"中级";s:1:"0";s:5:"轻微";s:1:"0";} s:17:"RequestedShipment";a:11:{s:11:"DropoffType";s:14:"REGULAR_PICKUP";s:13:"ShipTimestamp";s:25:"2011-12-08T20:33: 05+00:00";s:13:" PackagingType";s:14:"YOUR_PACKAGING";s:17:"TotalInsuredValue";a:2:{s:7:"金额";d:129.06999999999999317878973670303821563720703125; s:8:"货币";s:3:"美元";}s:7:"发货人";a:1:{s:7:"地址";a:2:{s:10:"邮政编码" ;s:5:"07094";s:11:"国家代码";s:2:"美国";}}s:9:"记录pient";a:1:{s:7:"地址";a:3:{s:10:"邮政编码";s:5:"10033";s:11:"国家/地区代码";s:2:"美国";s:11:"住宅";b:1;}}s:22:"ShippingChar gesPayment";a:2:{s:11:"付款类型";s:6:"发件人";s:5:"付款人";a:2:{s:13:"帐号";s:9:" 368675440";s:11:"国家/地区代码";s:2:"美国";} }s:16:"RateRequestTypes";s:4:"列表";s:12:"PackageCount";s:1:"1";s:13:"PackageDetail";s:19:"INDIVIDUAL_PACKAGES";s :25:"请求的Packa geLineItems";a:1:{i:0;a:1:{s:6:"重量";a:2:{s:5:"值";d:145.3600000000000136424205265939235687255859375;s:5:"单位"; s:2:"LB";}}}}}
(替换了实际的密码、密钥等,不希望它们公开)。
各位,怎么了?如何解决这个问题?我召唤 Magento 1.6 FedEx 高手!我想我不是唯一一个有这样问题的人!
As you might know, there's FedEx Web Services API in Magento. But I still can't make it work.
Entered all (password, account id, key and so on) in the admin end of the Magento.
Still getting
This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.
Tried to catch what's happening in code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
Right when the SOAP request is sent, line ~360:
$requestString = serialize($ratesRequest);
$response = $this->_getCachedQuotes($requestString);
Caught $requestString
and $response
.$response
is always empty (print_r gives empty string), also tried to set "Sandbox mode" both Yes and No in the admin-end.
The $requestString
is:
a:4:{s:23:"WebAuthenticationDetail";a:1:{s:14:"UserCredential";a:2:{s:3:"Key";s:16:"KEY";s:8:"Password";s:6:"PASSWD";}}s:12:"ClientDetail";a:2:{s:13:"AccountNumber";s:9:"ACCNUMBER";s:11:"MeterNumber";s:9:"METER NUMBER";}s:7:"Version";a:4:{s:9:"ServiceId";s:3:"crs";s:5:"Major";s:1:"9";s:12:"Intermediate";s:1:"0";s:5:"Minor";s:1:"0";}s:17:"RequestedShipment";a:11:{s:11:"DropoffType";s:14:"REGULAR_PICKUP";s:13:"ShipTimestamp";s:25:"2011-12-08T20:33:05+00:00";s:13:"PackagingType";s:14:"YOUR_PACKAGING";s:17:"TotalInsuredValue";a:2:{s:7:"Ammount";d:129.06999999999999317878973670303821563720703125;s:8:"Currency";s:3:"USD";}s:7:"Shipper";a:1:{s:7:"Address";a:2:{s:10:"PostalCode";s:5:"07094";s:11:"CountryCode";s:2:"US";}}s:9:"Recipient";a:1:{s:7:"Address";a:3:{s:10:"PostalCode";s:5:"10033";s:11:"CountryCode";s:2:"US";s:11:"Residential";b:1;}}s:22:"ShippingChargesPayment";a:2:{s:11:"PaymentType";s:6:"SENDER";s:5:"Payor";a:2:{s:13:"AccountNumber";s:9:"368675440";s:11:"CountryCode";s:2:"US";}}s:16:"RateRequestTypes";s:4:"LIST";s:12:"PackageCount";s:1:"1";s:13:"PackageDetail";s:19:"INDIVIDUAL_PACKAGES";s:25:"RequestedPackageLineItems";a:1:{i:0;a:1:{s:6:"Weight";a:2:{s:5:"Value";d:145.3600000000000136424205265939235687255859375;s:5:"Units";s:2:"LB";}}}}}
(replaced actual password, key and so on, don't want them public).
Guys, what the matter? How to fix this? I summon Magento 1.6 FedEx gurus! Guess I'm not the only one who has such problem!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,实际上我得到了错误的响应(稍后在代码中,如果响应为空,Magento 会尝试向 FedEx 服务器发出 SOAP 请求)。然后它因 SOAP 错误而崩溃:它未安装在服务器上。
要解决此问题,您应该在服务器上安装 SOAP 和 OpenSSL。
如果您使用 WHM 支持的服务器(我的例子),您应该重新编译软件包(WHM -> Software -> Easy Apache)。之后,magento 1.6 就可以用于 FedEx 了。
另请注意,不支持新的 FedEx API(但支持已弃用的 API),因此,如果您计划将 FedEx 与 Magento 一起使用,则必须将其更新到 1.6.x 或更高版本,并安装 SOAP 和 SSL在你的服务器上..
OK, actually I caought the wrong response (later in code, if response is empty, Magento tries to make SOAP-request to FedEx Server). And then it crashed with SOAP error: it's not installed on server.
To fix this you should install SOAP and OpenSSL to your server.
If you use WHM-powered server (my case), you should recompile the package (WHM -> Software -> Easy Apache). After that magento 1.6 is ready for FedEx.
Please also notice that there was no support for the new FedEx API (but there was for the deprecated one), so if you plan to use FedEx with Magento, you HAVE to update it to 1.6.x or greater AND have SOAP and SSL installed on your server..