Closed Marycka9 closed 6 years ago
I install your module and I have error:
/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php Client/HttpClient.php
/** * Look for errors in the request. * * @param array $parsedResponse Parsed body response. */ protected function lookForErrors($parsedResponse) { // Any non-200/201/202 response code indicates an error. if (!\in_array($this->response->getCode(), ['200', '201', '202'])) { $errors = !empty($parsedResponse['errors']) ? $parsedResponse['errors'] : $parsedResponse; if (!empty($errors[0])) { $errorMessage = $errors[0]['message']; $errorCode = $errors[0]['code']; } else { $errorMessage = $errors['message']; **$errorCode = $errors['code'];** . // This error } throw new HttpClientException(\sprintf('Error: %s [%s]', $errorMessage, $errorCode), $this->response->getCode(), $this->request, $this->response); } } /** * Process response. * * @return array */ protected function processResponse() { $body = $this->response->getBody(); if (0 === strpos(bin2hex($body), 'efbbbf')) { $body = substr($body, 3); } $parsedResponse = \json_decode($body, true);
Arguments"Undefined index: code"
This is not an issue with this package. It's related to https://github.com/woocommerce/wc-api-php. I'm just wrapping this functionality
I install your module and I have error:
/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php Client/HttpClient.php
Arguments"Undefined index: code"