_apiKey); $url = $this->instanceUrl() . '/rates'; list($response, $apiKey) = $requestor->request('get', $url, $params); $this->refreshFrom($response, $apiKey, true); return $this; } /** * buy an order * * @param mixed $params * @return $this * @throws \EasyPost\Error */ public function buy($params = null) { $requestor = new Requestor($this->_apiKey); $url = $this->instanceUrl() . '/buy'; if ($params instanceof Rate) { $clone = $params; unset($params); $params['carrier'] = $clone->carrier; $params['service'] = $clone->service; } list($response, $apiKey) = $requestor->request('post', $url, $params); $this->refreshFrom($response, $apiKey, false); return $this; } }