亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Google Shopping Content returnrefundlineitem

Google Shopping Content returnrefundlineitem

PHP
慕沐林林 2022-01-14 15:38:24
在看到谷歌內容api中的文檔后,我試圖發送請求,每件事看起來都是正確的https://www.googleapis.com/content/v2.1sandbox/myid/orders/orderid/returnRefundLineItem但谷歌回應了 400 錯誤請求“格式錯誤的請求”導致了一個400 Bad Request.谷歌內容 API 響應:{ "error": {  "errors": [   {    "domain": "content.ContentErrorDomain",    "reason": "malformed_request",    "message": "Malformed request"   }  ],  "code": 400,  "message": "Malformed request" }}這是我的請求正文{  "operationId": "operation-6f8fa23bce94444b87e",  "lineItemId": "QGKPTRMCKNCZESI",  "quantity": 10,  "reason": "other",  "reasonText": "other",  "priceAmount": {    "value": "4500.00",    "currency": "EUR"  },  "taxAmount": {    "value": "0.00",    "currency": "EUR"  }}將執行 guzzle 請求的函數    public function execute($api, $requestType = 'GET', $body = null) {        $client = new \GuzzleHttp\Client();        $token = $this->container->get('config')->findOneByCode($this->configCode);        $token = $token->getOptions();        $requestOptions = ['headers' => ['Authorization' => 'Bearer ' . $token, 'Content-Type' => 'application/json', 'Accept' => 'application/json']];        if (null !== $body) {            $requestOptions = array_merge($requestOptions, ['body' => $body]);        }        $response = $client->request($requestType, $this->url . '/' . $this->merchant_id . '/' . $api, $requestOptions);        if ($response->getStatusCode() === 200) {            return (string)$response->getBody();        }        return false;    }
查看完整描述

1 回答

?
呼啦一陣風

TA貢獻1802條經驗 獲得超6個贊

我通過使用另一個退款功能 createrefundinvoice解決了我的問題

因為我使用“enableOrderinvoices”創建了訂單:true

使用returnrefundlineitem

設置 "enableOrderinvoices": false 將解決問題


查看完整回答
反對 回復 2022-01-14
  • 1 回答
  • 0 關注
  • 197 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號