![]() ![]() Now this works until my access token expires and I need to generate a new one, I'm just not sure how to update my access token and store the new refresh token properly to keep access to my app always refreshed. $dataService = $this->helperData->getConfigurationSetting() $dataService->updateOAuth2Token($refreshedAccessTokenObj) Īnd then I'm calling that from my controller: helperData = $helperData $dataService->throwExceptionOnError(true) Integrate QuickBooks with PHP sdk and web connector on desktop Hello All,I want to implement quickbook with help of php sdk and web connector.I have download the phpsdk and quickbook on localhost,but i am not gettinguse of web connector.How can i can integrate these three setup for data exchangeon windows using desktop.I need it on desktop. $error = $OAuth2LoginHelper->getLastError() $refreshedAccessTokenObj = $OAuth2LoginHelper->refreshToken() Actually I added a new library called QuickBooks-V3-PHP-SDK but before to that, there was another library belongs to Quickbooks and both have same class IPPCoustomer, so whenever I called any dataservice functions it was importing old library classes. $OAuth2LoginHelper = $dataService->getOAuth2LoginHelper() So my question is, how do I properly store and call upon my refresh token to generate a new access token each time my API makes a call to sync data.Ĭurrently, I'm directly using my OAuth tokens by hard coding them into my helper file: 'oauth2', In QuickBooks Online OAuth 2 protocol, it is not the access token you should store, it is the refresh token you need to store. Just remember, whenever you make a refreshToken API call, always STORE THE LATEST REFRESH TOKEN value in your session or database. It is used to request a new access token after access token expired, so you can still access to the QBO company after an hour. If you try to make an API call after an hour with the same access token, the request will be blocked by QBO. Dynamic snippets Ultra-fast coding Customizable. I've created a QBO App but this is my first time using oauth and I'm a bit confused on how to store and use the access / refresh tokens.Īccording to Quickbooks doc I need to store the latest refresh token:Įach access token can only be valid for an hour after its creation. Youve already known how to use Emmet abbreviations: its syntax is inspired by CSS selectors. QuickBooks offers an official PHP SDK for the Online Accounting API. config.php: This is a file to store the environment variables youll need to connect to the API. getInvoices.php: This contains a function to fetch invoices. ![]() ![]() The SDK allows you to modify the log settings without having to redeploy the application by changing the location of the request/response logs, and by disabling and re-enabling logging. createInvoice.php: This contains the function that includes the invoice creation logic. The logs help with application debugging and can be saved on a local file system. I have a Magento 2.3 store that I'm trying to sync some data to Quickbooks Online. The SDK by default logs requests and responses to XML files. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |