public function clientCredentials()
    {
        if (! $this->credentials) {
            // $this->credentials = new ClientCredentials;
            $this->credentials = new Credentials('client_credentials');

            // Get API endpoints
            $this->endpointDiscovery();

            // Acquire the tokens and expiration and save
            $body = $this->acquireToken();
            $this->credentials->set($body);

            // Add credentials to the cache
            $creds = serialize($this->credentials);
            $expiration = $this->credentials->getExpiration();
            $this->cache->put($this->cacheKey, $creds, $expiration );
        }

        return $this;
    }
public function clientCredentials()
    {
        if (! $this->credentials) {
            // $this->credentials = new ClientCredentials;
            $this->credentials = new Credentials('client_credentials');

            // Get API endpoints
            $this->endpointDiscovery();

            // Acquire the tokens and expiration and save
            $body = $this->acquireToken();
            $this->credentials->set($body);

            // Add credentials to the cache
            $creds = serialize($this->credentials);
            $expiration = $this->credentials->getExpiration();
            $this->cache->put($this->cacheKey, $creds, $expiration );
        }

        return $this;
    }
public function clientCredentials ( ) { if ( ! $ this -> credentials ) { // $this->credentials = new ClientCredentials; $ this -> credentials = new Credentials ( 'client_credentials' ) ; // Get API endpoints $ this -> endpointDiscovery ( ) ; // Acquire the tokens and expiration and save $ body = $ this -> acquireToken ( ) ; $ this -> credentials -> set ( $ body ) ; // Add credentials to the cache $ creds = serialize ( $ this -> credentials ) ; $ expiration = $ this -> credentials -> getExpiration ( ) ; $ this -> cache -> put ( $ this -> cacheKey , $ creds , $ expiration ) ; } return $ this ; }
Performs discovery request and gets the token
@return $this|bool
Performs discovery request and gets the token