示例#1
0
 public function authorize()
 {
     $endpoints = Config::get('ENDPOINTS');
     $requestOptions = ['auth' => [$this->clientId, $this->clientSecret], 'json' => ['grant_type' => 'client_credentials']];
     $response = $this->request->send($endpoints['authorize']['method'], $endpoints['authorize']['route'], $requestOptions);
     $this->accessToken = $response['access_token'];
     $this->expires = time() + $response['expires_in'];
     $this->tokenType = $response['token_type'];
 }
示例#2
0
 public function __construct($options, $requester = null)
 {
     $this->requester = $requester;
     if (!$this->requester) {
         $this->requester = new ApiRequest($options);
     }
     $this->endpoints = Config::get('ENDPOINTS');
     $this->map();
 }