private function getToken()
    {
        $data = array(
            'grant_type' => 'client_credentials',
            'client_id' => $this->userId,
            'client_secret' => $this->secret,
        );

        $requestResult = $this->sendRequest('oauth/access_token', 'POST', $data, false);

        if ($requestResult->http_code !== 200) {
            return false;
        }

        $this->refreshToken = 0;
        $this->token = $requestResult->data->access_token;

        $hashName = md5($this->userId . '::' . $this->secret);
        /** Save token to storage */
        $this->tokenStorage->set($hashName, $this->token);

        return true;
    }
private function getToken()
    {
        $data = array(
            'grant_type' => 'client_credentials',
            'client_id' => $this->userId,
            'client_secret' => $this->secret,
        );

        $requestResult = $this->sendRequest('oauth/access_token', 'POST', $data, false);

        if ($requestResult->http_code !== 200) {
            return false;
        }

        $this->refreshToken = 0;
        $this->token = $requestResult->data->access_token;

        $hashName = md5($this->userId . '::' . $this->secret);
        /** Save token to storage */
        $this->tokenStorage->set($hashName, $this->token);

        return true;
    }
private function getToken ( ) { $ data = array ( 'grant_type' => 'client_credentials' , 'client_id' => $ this -> userId , 'client_secret' => $ this -> secret , ) ; $ requestResult = $ this -> sendRequest ( 'oauth/access_token' , 'POST' , $ data , false ) ; if ( $ requestResult -> http_code !== 200 ) { return false ; } $ this -> refreshToken = 0 ; $ this -> token = $ requestResult -> data -> access_token ; $ hashName = md5 ( $ this -> userId . '::' . $ this -> secret ) ; /** Save token to storage */ $ this -> tokenStorage -> set ( $ hashName , $ this -> token ) ; return true ; }
Get token and store it

@return bool
Get token and store it