public function performHttpCallToFullUrl($httpMethod, $url, $httpBody = null)
    {
        if (empty($this->apiKey)) {
            throw new ApiException("You have not set an API key or OAuth access token. Please use setApiKey() to set the API key.");
        }

        $userAgent = implode(' ', $this->versionStrings);

        if ($this->usesOAuth()) {
            $userAgent .= " OAuth/2.0";
        }

        $headers = [
            'Accept' => "application/json",
            'Authorization' => "Bearer {$this->apiKey}",
            'User-Agent' => $userAgent,
        ];

        if (function_exists("php_uname")) {
            $headers['X-Mollie-Client-Info'] = php_uname();
        }

        $request = new Request($httpMethod, $url, $headers, $httpBody);

        try {
            $response = $this->httpClient->send($request, ['http_errors' => false]);
        } catch (GuzzleException $e) {
            throw ApiException::createFromGuzzleException($e);
        }

        if (!$response) {
            throw new ApiException("Did not receive API response.");
        }

        return $this->parseResponseBody($response);
    }
public function performHttpCallToFullUrl($httpMethod, $url, $httpBody = null)
    {
        if (empty($this->apiKey)) {
            throw new ApiException("You have not set an API key or OAuth access token. Please use setApiKey() to set the API key.");
        }

        $userAgent = implode(' ', $this->versionStrings);

        if ($this->usesOAuth()) {
            $userAgent .= " OAuth/2.0";
        }

        $headers = [
            'Accept' => "application/json",
            'Authorization' => "Bearer {$this->apiKey}",
            'User-Agent' => $userAgent,
        ];

        if (function_exists("php_uname")) {
            $headers['X-Mollie-Client-Info'] = php_uname();
        }

        $request = new Request($httpMethod, $url, $headers, $httpBody);

        try {
            $response = $this->httpClient->send($request, ['http_errors' => false]);
        } catch (GuzzleException $e) {
            throw ApiException::createFromGuzzleException($e);
        }

        if (!$response) {
            throw new ApiException("Did not receive API response.");
        }

        return $this->parseResponseBody($response);
    }
public function performHttpCallToFullUrl ( $ httpMethod , $ url , $ httpBody = null ) { if ( empty ( $ this -> apiKey ) ) { throw new ApiException ( "You have not set an API key or OAuth access token. Please use setApiKey() to set the API key." ) ; } $ userAgent = implode ( ' ' , $ this -> versionStrings ) ; if ( $ this -> usesOAuth ( ) ) { $ userAgent .= " OAuth/2.0" ; } $ headers = [ 'Accept' => "application/json" , 'Authorization' => "Bearer {$this->apiKey}" , 'User-Agent' => $ userAgent , ] ; if ( function_exists ( "php_uname" ) ) { $ headers [ 'X-Mollie-Client-Info' ] = php_uname ( ) ; } $ request = new Request ( $ httpMethod , $ url , $ headers , $ httpBody ) ; try { $ response = $ this -> httpClient -> send ( $ request , [ 'http_errors' => false ] ) ; } catch ( GuzzleException $ e ) { throw ApiException :: createFromGuzzleException ( $ e ) ; } if ( ! $ response ) { throw new ApiException ( "Did not receive API response." ) ; } return $ this -> parseResponseBody ( $ response ) ; }
Perform an http call to a full url. This method is used by the resource specific classes.

@see $payments
@see $isuers

@param string $httpMethod
@param string $url
@param string|null|resource|StreamInterface $httpBody

@return object|null
@throws ApiException

@codeCoverageIgnore
Perform an http call to a full url . This method is used by the resource specific classes .