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;
}
IntegrationLog.Log(QBID, "RefreshTokens: Token expired, fetching new one...");
try
{
//refresh token here
var v = oac.RefreshTokenAsync(REFRESH_TOKEN).Result;
TOKEN_BIRTHDAY = DateTime.Now;
ACCESS_TOKEN = v.AccessToken;
REFRESH_TOKEN = v.RefreshToken;
//refresh token here
var v = oac.RefreshTokenAsync(REFRESH_TOKEN).Result;
TOKEN_BIRTHDAY = DateTime.Now;
ACCESS_TOKEN = v.AccessToken;
REFRESH_TOKEN = v.RefreshToken;
}
catch (Exception ex)
{
IntegrationLog.Log(QBID, "RefreshTokens: Exception error attempting to refresh token:");
IntegrationLog.Log(QBID, CrackException(ex));
}
}
@@ -574,14 +583,15 @@ namespace AyaNova.PlugIn.QBOI
if (!_AuthenticationCompleted)
{
IntegrationLog.Log(QBID, "PFC: Authenticating...");
if (!StartAuthorization()) {
//user cancelled or some other issue, close qboi
if (!StartAuthorization())
{
//user cancelled or some other issue, close qboi
IntegrationLog.Log(QBID, "PFC: QuickBooks connection not authorized");
return pfstat.Cancel;
}
}
IntegrationLog.Log(QBID, "PFC: Authentication completed, validating company data");
if (QBValidate() == pfstat.Cancel)
@@ -2744,7 +2754,7 @@ KEY: AssignedTime, VALUE: 12/08/2017 18:52:04
public static void RefreshAyaNovaClientFromQB(List<Guid> objectIDList)
{
PopulateQBClientCache();
foreach (Guid g in objectIDList)
{
@@ -2762,7 +2772,7 @@ KEY: AssignedTime, VALUE: 12/08/2017 18:52:04
public static void RefreshAyaNovaClientFromQB(Client c)
{
PopulateQBClientCache();
IntegrationMap im = QBOIntegration.Maps[c.ID];
if (im == null) return;//this client is not linked