QuickBooks-V3-PHP-SDK icon indicating copy to clipboard operation
QuickBooks-V3-PHP-SDK copied to clipboard

refreshtoken 24 hour expiration,my code wrong?

Open yingyuhaonan opened this issue 2 years ago • 2 comments

$dataService = DataService::Configure( [ 'auth_mode' => 'oauth2', 'ClientID' => $list['clientID'], 'ClientSecret' => $list['clientSecret'], 'RedirectURI' => "XXXXXX", 'scope' => "com.intuit.quickbooks.payment com.intuit.quickbooks.accounting", 'state' => $list['stat'], 'baseUrl' => "Development", ] ); $OAuth2LoginHelper = $dataService->getOAuth2LoginHelper();

    $accessTokenObj    = $OAuth2LoginHelper->exchangeAuthorizationCodeForToken( $list['code'], $list['QBORealmID'] );
   // $result=$dataService->updateOAuth2Token($accessTokenObj);

    $id            = $offcustomerQB->saveDate( [
                                                   'id'            => $id,
                                                   'accessTokenKey'      => $accessTokenObj->getAccessToken(),
                                                   'refreshTokenKey'     => $accessTokenObj->getRefreshToken(),
                                                   'accessTokenTimeout'  => strtotime($accessTokenObj->getAccessTokenExpiresAt()),
                                                   'refreshTokenTimeout' => strtotime($accessTokenObj->getRefreshTokenExpiresAt()),

                                               ] );

yingyuhaonan avatar Apr 18 '22 02:04 yingyuhaonan