This commit is contained in:
2019-10-07 19:11:32 +00:00
parent 2db498d69b
commit c00fee9f30

View File

@@ -383,12 +383,21 @@ namespace AyaNova.PlugIn.QBOI
{ {
return; return;
} }
IntegrationLog.Log(QBID, "RefreshTokens: Token expired, fetching new one...");
try
{
//refresh token here //refresh token here
var v = oac.RefreshTokenAsync(REFRESH_TOKEN).Result; var v = oac.RefreshTokenAsync(REFRESH_TOKEN).Result;
TOKEN_BIRTHDAY = DateTime.Now; TOKEN_BIRTHDAY = DateTime.Now;
ACCESS_TOKEN = v.AccessToken; ACCESS_TOKEN = v.AccessToken;
REFRESH_TOKEN = v.RefreshToken; REFRESH_TOKEN = v.RefreshToken;
}
catch (Exception ex)
{
IntegrationLog.Log(QBID, "RefreshTokens: Exception error attempting to refresh token:");
IntegrationLog.Log(QBID, CrackException(ex));
}
} }
@@ -574,8 +583,9 @@ namespace AyaNova.PlugIn.QBOI
if (!_AuthenticationCompleted) if (!_AuthenticationCompleted)
{ {
IntegrationLog.Log(QBID, "PFC: Authenticating..."); IntegrationLog.Log(QBID, "PFC: Authenticating...");
if (!StartAuthorization()) { if (!StartAuthorization())
//user cancelled or some other issue, close qboi {
//user cancelled or some other issue, close qboi
IntegrationLog.Log(QBID, "PFC: QuickBooks connection not authorized"); IntegrationLog.Log(QBID, "PFC: QuickBooks connection not authorized");
return pfstat.Cancel; return pfstat.Cancel;
} }