0

我正在尝试将跟踪数据添加到订单中,但出现以下错误:

致命错误:未捕获的异常 'Google_Service_Exception' 带有消息'{“错误”:{“错误”:[{“域”:“全局”,“原因”:“无效”,“消息”:“shipmentInfos 的值无效:{承运人=ups, shippingId=A69239235, trackingId=1Z302Y375441956420}", "locationType": "other", "location": "" } ], "code": 400, "message": "invalid value for shippingInfos: {carrier= ups, shippingId=A69239235, trackingId=1Z302Y375441956420}" } } ' 在 /var/www/html/ta2/gsa/vendor/google/apiclient/src/Google/Http/REST.php:118 堆栈跟踪:#0 /var /www/html/ta2/gsa/vendor/google/apiclient/src/Google/Http/REST.php(94): Google_Http_REST::decodeHttpResponse(Object(GuzzleHttp\Psr7\Response),Object(GuzzleHttp\Psr7\Request), 'Google_Service_...') #1 [内部函数]: Google_Http_REST::doExecute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), 'Google_Service_...' ) #2 /var/www/html/ta2/gsa/vendor/google/apiclient/src/Google/Task/Runner.php(176): call_user_func_array(Array, Array) #3 /var/www/html/ta2/第 118 行 /var/www/html/ta2/gsa/vendor/google/apiclient/src/Google/Http/REST.php 中的 g

我尝试提交其他值并继续收到类似的错误。

$shipmentInfo = new Google_Service_ShoppingContent_OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo();
$shipId = "A".mt_rand();
$shipmentInfo->setShipmentId("{$shipId}");
$shipmentInfo->setCarrier("ups");
$shipmentInfo->setTrackingId("{$orderRec[$skuRec]}");

关于我在这里做错了什么有什么想法吗?

PS 出于隐私原因,我更改了此处发布的跟踪号。

4

1 回答 1

0

$shipmentInfo 需要是一个数组。

于 2019-01-15T16:23:29.523 回答