【发布时间】:2015-01-26 07:01:44
【问题描述】:
我目前正在尝试向 eBay 发送信息以设置订单发货/跟踪详细信息。目前我收到一条“成功”消息,但 eBay 网站上没有任何信息更新。
我一直在使用以下链接来指导我实施此更改:
http://developer.ebay.com/devzone/large-merchant-services/Concepts/MakingACall.html
http://developer.ebay.com/devzone/merchant-data/CallRef/SetShipmentTrackingInfo.html#Samples
我发回的 XML 格式与描述的完全相同,请参阅下面我发送的详细信息以及用于通过 eBay 的 API 通过 CURL 发送的 PHP。
XML:
<?xml version="1.0" encoding="UTF-8"?>
<BulkDataExchangeRequests>
<Header>
<Version>591</Version>
<SiteID>0</SiteID>
</Header>
<SetShipmentTrackingInfoRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<OrderID>261671515555-0</OrderID>
<OrderLineItemID>261672341232</OrderLineItemID>
<Shipment>
<ShipmentTrackingNumber>JD0002250296232332</ShipmentTrackingNumber>
<ShippedTime>2014-11-27T14:41:27\Z</ShippedTime>
<ShippingCarrierUsed>Yodel</ShippingCarrierUsed>
</Shipment>
</SetShipmentTrackingInfoRequest>
</BulkDataExchangeRequests>
PHP:
$xml_request = "";
$connection = curl_init();
curl_setopt($connection, CURLOPT_URL, $ebay_url);
curl_setopt($connection, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($connection, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($connection, CURLOPT_HTTPHEADER, $headers);
curl_setopt($connection, CURLOPT_POST, 1);
curl_setopt($connection, CURLOPT_POSTFIELDS, $xml_request);
curl_setopt($connection, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($connection);
curl_close($connection);
var_dump($response);
【问题讨论】:
-
你能告诉我们 $response 中有什么吗?
-
请看下面的回复:string(211) "Success1.5.02014-12-08T12:00:39.013Z"