Google 服务异常 ShipmentInfos(Google 订单 API)
Google Service Exception ShipmentInfos (Google Orders API)
我正在尝试向订单添加跟踪数据,但出现以下错误:
致命错误:未捕获异常 'Google_Service_Exception' 消息 '{ "error": { "errors": [ { "domain": "global", "reason": "invalid", "message": "Invalid value for shipmentInfos: {carrier=ups, shipmentId=A69239235, trackingId=1Z302Y375441956420}", "locationType": "other", "location": "" } ], "code": 400 , "message": "Invalid value for shipmentInfos: {carrier=ups, shipmentId=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) , 对象(GuzzleHttp\Psr7\Request), 'Google_Service_...') #2 /var/www/html/ta2/gsa/vendor/google/apiclient/src/Google/Task/Runner.php(176): call_user_func_array(数组, 数组) #3 /var/www/html/ta2/g在第 118 行/var/www/html/ta2/gsa/vendor/google/apiclient/src/Google/Http/REST.php
我已经尝试提交其他值,但仍然出现类似的错误。
$shipmentInfo = new Google_Service_ShoppingContent_OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo();
$shipId = "A".mt_rand();
$shipmentInfo->setShipmentId("{$shipId}");
$shipmentInfo->setCarrier("ups");
$shipmentInfo->setTrackingId("{$orderRec[$skuRec]}");
对我在这里做错了什么有什么想法吗?
P.S。出于隐私原因,我更改了此处发布的跟踪号码。
$shipmentInfo 需要是一个数组。
我正在尝试向订单添加跟踪数据,但出现以下错误:
致命错误:未捕获异常 'Google_Service_Exception' 消息 '{ "error": { "errors": [ { "domain": "global", "reason": "invalid", "message": "Invalid value for shipmentInfos: {carrier=ups, shipmentId=A69239235, trackingId=1Z302Y375441956420}", "locationType": "other", "location": "" } ], "code": 400 , "message": "Invalid value for shipmentInfos: {carrier=ups, shipmentId=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) , 对象(GuzzleHttp\Psr7\Request), 'Google_Service_...') #2 /var/www/html/ta2/gsa/vendor/google/apiclient/src/Google/Task/Runner.php(176): call_user_func_array(数组, 数组) #3 /var/www/html/ta2/g在第 118 行/var/www/html/ta2/gsa/vendor/google/apiclient/src/Google/Http/REST.php
我已经尝试提交其他值,但仍然出现类似的错误。
$shipmentInfo = new Google_Service_ShoppingContent_OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo();
$shipId = "A".mt_rand();
$shipmentInfo->setShipmentId("{$shipId}");
$shipmentInfo->setCarrier("ups");
$shipmentInfo->setTrackingId("{$orderRec[$skuRec]}");
对我在这里做错了什么有什么想法吗?
P.S。出于隐私原因,我更改了此处发布的跟踪号码。
$shipmentInfo 需要是一个数组。