app\Economic::getClient PHP Method

getClient() protected method

protected getClient ( )
    protected function getClient()
    {
        if (!$this->client) {
            $this->client = new \GuzzleHttp\Client();
            $res = $this->client->request('GET', 'https://restapi.e-conomic.com/customers', ['verify' => false, 'headers' => ['X-AppSecretToken:' => 'demo', 'X-AgreementGrantToken' => 'demo', 'Content-Type' => 'application/json']]);
            $response = self::convertJson($res);
            self::$accessToken = $response->access_token;
        }
        return $this->client;
    }