예제 #1
0
 /**
  * @return Transaction
  * @throws Exception
  */
 public function refresh()
 {
     if (!$this->auth->isRefreshTokenValid()) {
         throw new Exception('Refresh token has expired');
     }
     // Synchronous
     $response = $this->authCall(self::TOKEN_ENDPOINT, array("grant_type" => "refresh_token", "refresh_token" => $this->auth->getRefreshToken(), "access_token_ttl" => self::ACCESS_TOKEN_TTL, "refresh_token_ttl" => $this->auth->isRemember() ? self::REFRESH_TOKEN_TTL_REMEMBER : self::REFRESH_TOKEN_TTL));
     $this->auth->setData($response->getJson(false));
     return $response;
 }
예제 #2
0
 /**
  * @return ApiResponse
  * @throws ApiException
  */
 public function refresh()
 {
     if (!$this->_auth->refreshTokenValid()) {
         throw new ApiException(null, new Exception('Refresh token has expired'));
     }
     // Synchronous
     $response = $this->requestToken(self::TOKEN_ENDPOINT, array("grant_type" => "refresh_token", "refresh_token" => $this->_auth->refreshToken(), "access_token_ttl" => self::ACCESS_TOKEN_TTL, "refresh_token_ttl" => self::REFRESH_TOKEN_TTL));
     $this->_auth->setData($response->jsonArray());
     return $response;
 }