This commit is contained in:
@@ -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,14 +583,15 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IntegrationLog.Log(QBID, "PFC: Authentication completed, validating company data");
|
IntegrationLog.Log(QBID, "PFC: Authentication completed, validating company data");
|
||||||
|
|
||||||
if (QBValidate() == pfstat.Cancel)
|
if (QBValidate() == pfstat.Cancel)
|
||||||
@@ -2744,7 +2754,7 @@ KEY: AssignedTime, VALUE: 12/08/2017 18:52:04
|
|||||||
|
|
||||||
public static void RefreshAyaNovaClientFromQB(List<Guid> objectIDList)
|
public static void RefreshAyaNovaClientFromQB(List<Guid> objectIDList)
|
||||||
{
|
{
|
||||||
|
|
||||||
PopulateQBClientCache();
|
PopulateQBClientCache();
|
||||||
foreach (Guid g in objectIDList)
|
foreach (Guid g in objectIDList)
|
||||||
{
|
{
|
||||||
@@ -2762,7 +2772,7 @@ KEY: AssignedTime, VALUE: 12/08/2017 18:52:04
|
|||||||
|
|
||||||
public static void RefreshAyaNovaClientFromQB(Client c)
|
public static void RefreshAyaNovaClientFromQB(Client c)
|
||||||
{
|
{
|
||||||
|
|
||||||
PopulateQBClientCache();
|
PopulateQBClientCache();
|
||||||
IntegrationMap im = QBOIntegration.Maps[c.ID];
|
IntegrationMap im = QBOIntegration.Maps[c.ID];
|
||||||
if (im == null) return;//this client is not linked
|
if (im == null) return;//this client is not linked
|
||||||
|
|||||||
Reference in New Issue
Block a user