/** * @return Response */ public function requestAccessToken() { $this->prepareRequest(); $this->request->setUri($this->configuration->getBaseUri() . self::TOKEN_ENDPOINT); $this->request->setMethod('POST'); $payload = $this->httpClient->buildQuery(array('client_id' => $this->configuration->getClientId(), 'client_secret' => $this->configuration->getClientSecret(), 'grant_type' => $this->configuration->getGrantType(), 'username' => $this->configuration->getUsername(), 'password' => $this->configuration->getPassword(), 'company' => $this->configuration->getCompany())); $this->request->setPayload($payload); return $this->httpClient->send($this->request); }