Returns the full URL to use when requesting an access token.

@param array $params Query parameters
@return string
172920
protected function getAccessTokenUrl(array $params)
    {
        $url = $this->getBaseAccessTokenUrl($params);

        if ($this->getAccessTokenMethod() === self::METHOD_GET) {
            $query = $this->getAccessTokenQuery($params);
            return $this->appendQuery($url, $query);
        }

        return $url;
    }
1172572
protected function getAccessTokenRequest(array $params)
    {
        if (isset($params['scope']) && is_array($params['scope'])) {
            $separator = $this->getScopeSeparator();
            $params['scope'] = implode($separator, $params['scope']);
        }

        return parent::getAccessTokenRequest($params);
    }
778963
public function getIndexUrl(array $params = array(), array $options = array())
    {
        return $this->url()->fromRoute($this->getEvent()->getRouteMatch()->getMatchedRouteName(),
            array_merge(array('action' => 'index'), $params),
            $options
        );
    }
797662
private function buildQueryString(array $params)
    {
        $flattened = [];
        foreach ($params as $key => $value) {
            $flattened[] = $key . '=' . $value;
        }
        $queryString = implode('&', $flattened);

        return $queryString;
    }
603021
protected function getAccessTokenRequest(array $params)
    {
        $method  = $this->getAccessTokenMethod();
        $url     = $this->getAccessTokenUrl($params);
        $options = $this->optionProvider->getAccessTokenOptions($this->getAccessTokenMethod(), $params);

        return $this->getRequest($method, $url, $options);
    }
430957
public static function getToken($params = null)
    {
        if (!$params) {
            $params = array();
        }
        $requestor = new ApiRequestor(Sumup::$connectBase, true);
        $params['client_id'] = self::_getConnectParam('client_id', $params);
        $params['client_secret'] = self::_getConnectParam('client_secret', $params);
        $response = $requestor->request('post', '/token', $params);

        if ($response->raw->getStatusCode() !== 200) {
            throw new Error\AuthenticationError('Token request error');
        }

        return new AccessToken($response);
    }
496644
private function _getParametersAsString(array $parameters)
    {
        $queryParameters = array();
        foreach ($parameters as $key => $value) {
            $queryParameters[] = $key . '=' . $this->_urlencode($value);
        }
        return implode('&', $queryParameters);
    }
308006
private static function getCacheKeyForCall(array $params)
    {
        static $domainLevel = null;

        $params += $_GET;
        $keyStr = '';
        foreach ($params as $param) {
            $keyStr .= serialize($param);
        }

        $keyStr .= Request::domainPrefix(
            $domainLevel ?? $domainLevel = count(explode('.', Config::application('domain')))
        );

        return md5($keyStr);
    }
316319
public function getAuthorizationCode(array $params)
	{
		if (isset($params['transaction_state'])) {
			$params['transaction_state'] = json_encode($params['transaction_state']);
		}

		return $this->post('access/getAuthorizationCode', $params);
	}
132000
public static function assetURL(array $params)
    {
        if (isset($params['asset']) && is_object($params['asset'])) {
            $asset = $params['asset'];
            $params['asset'] = $params['asset']->getId();
        }

        if (!isset($params['action'])) {
            $params['action'] = 'view';
        }

        if (isset($params['height']) && !isset($params['width'])) {
            $params['width'] = 0;
        }

        $url = route('asset', $params);

        if (isset($asset)) {
            $url .= '?'.$asset->getLastModified()->getTimestamp();
        }

        return $url;
    }
979913
protected function getQueryParams(array $params = []): string
    {
        if (empty($params)) {
            return '';
        }
        $query = $params['query'] ?? [];
        if (is_string($query)) {
            return $query;
        }
        return empty($query) ? '' : http_build_query($query);
    }
853509
public function getUrl($name, $params = array())
	{
		if('http' === substr($name, 0, 4))
		{
			$domain = $name;
		}
		else
		{
			$domain = static::API_DOMAIN . $name;
		}
		return $domain . (empty($params) ? '' : ('?' . $this->http_build_query($params)));
	}
1062208
public static function authorizeUrl($params = null, $opts = null)
    {
        $params = $params ?: [];

        $base = ($opts && array_key_exists('connect_base', $opts)) ? $opts['connect_base'] : Stripe::$connectBase;

        $params['client_id'] = self::_getClientId($params);
        if (!array_key_exists('response_type', $params)) {
            $params['response_type'] = 'code';
        }
        $query = Util\Util::encodeParameters($params);

        return $base . '/oauth/authorize?' . $query;
    }
587437
private static function buildQuery ($url, $params = array())
    {
        $full_url = $url;

        if (count($params) > 0)
        {
            $full_url .= "?" . implode("&", $params);
        }

        return $full_url;
    }
1076018
private function getFullName(array $params): string
    {
        if (isset($params['full_name'])) {
            return $this->get($params, 'full_name', '');
        }

        return trim(sprintf('%s %s', $this->get($params, 'first', ''), $this->get($params, 'last', '')));
    }
122514
public function get($params) {
		$curl = curl_init();
		$header[] = "key: $this->api_key";
		$query = http_build_query($params);
		curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
		curl_setopt($curl, CURLOPT_URL, $this->api_url . "/" . $this->endpoint . "?" . $query);
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
		curl_setopt($curl, CURLOPT_ENCODING, "");
		curl_setopt($curl, CURLOPT_MAXREDIRS, 10);
		curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
		curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "GET");
		curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
		curl_setopt($curl, CURLOPT_TIMEOUT, 30);
		$request = curl_exec($curl);
		$return = ($request === FALSE) ? curl_error($curl) : $request;
		curl_close($curl);
		return $return;
	}
31593
protected function getAccessTokenRequest(array $params)
    {
        $request = parent::getAccessTokenRequest($params);
        $uri = $request->getUri()
            ->withUserInfo($this->clientId, $this->clientSecret);

        return $request->withUri($uri);
    }