protected function doRequest($method, $apiMethod, array $data = [])
    {
        $url = $this->config['endpoint'] . $apiMethod;
        $data = $this->mergeData($this->createAuthData(), $data);

        $response = $this->getGuzzleClient()->request($method, $url, ['json' => $data]);
        $responseContent = \GuzzleHttp\json_decode($response->getBody());

        if (!property_exists($responseContent, 'success') || !$responseContent->success) {
            throw new InvalidRequestException($method, $url, $data, $response);
        }

        return $responseContent;
    }
protected function doRequest($method, $apiMethod, array $data = [])
    {
        $url = $this->config['endpoint'] . $apiMethod;
        $data = $this->mergeData($this->createAuthData(), $data);

        $response = $this->getGuzzleClient()->request($method, $url, ['json' => $data]);
        $responseContent = \GuzzleHttp\json_decode($response->getBody());

        if (!property_exists($responseContent, 'success') || !$responseContent->success) {
            throw new InvalidRequestException($method, $url, $data, $response);
        }

        return $responseContent;
    }
protected function doRequest ( $ method , $ apiMethod , array $ data = [ ] ) { $ url = $ this -> config [ 'endpoint' ] . $ apiMethod ; $ data = $ this -> mergeData ( $ this -> createAuthData ( ) , $ data ) ; $ response = $ this -> getGuzzleClient ( ) -> request ( $ method , $ url , [ 'json' => $ data ] ) ; $ responseContent = \ GuzzleHttp \ json_decode ( $ response -> getBody ( ) ) ; if ( ! property_exists ( $ responseContent , 'success' ) || ! $ responseContent -> success ) { throw new InvalidRequestException ( $ method , $ url , $ data , $ response ) ; } return $ responseContent ; }
Send request to SalesManago API.

@param  string $method    HTTP Method
@param  string $apiMethod API Method
@param  array  $data      Request data
@return array
Send request to SalesManago API .