/** * Override API call to enable retry with servers' clock auto sync method. * * @param string $path * @param string $method * @param array $params * @param bool $retry Is in retry or first call attempt. * * @return array|mixed|string|void */ private function _call($path, $method = 'GET', $params = array(), $retry = false) { $this->_logger->entrance(); $result = $this->_api->Api($path, $method, $params); if (null !== $result && isset($result->error) && 'request_expired' === $result->error->code) { if (!$retry) { // Try to sync clock diff. if (false !== $this->_sync_clock_diff()) { return $this->_call($path, $method, $params, true); } } } if (null !== $result && isset($result->error)) { // Log API errors. $this->_logger->error($result->error->message); } return $result; }