From 56d37f0fd9c9dc35a232355195cde6c43da3ee4a Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 7 Oct 2019 19:41:06 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.QBOI/Util.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.QBOI/Util.cs b/source/Plugins/AyaNova.Plugin.QBOI/Util.cs index 40e79f7..26e0354 100644 --- a/source/Plugins/AyaNova.Plugin.QBOI/Util.cs +++ b/source/Plugins/AyaNova.Plugin.QBOI/Util.cs @@ -302,6 +302,7 @@ namespace AyaNova.PlugIn.QBOI const string Q2_CLIENT_SECRET = "XUmJyvEcEuwQuyhARUAm0a8G3gzbEAeMiATCLyFZ"; const string Q2_REDIRECT_URL = "https://qboauth.ayanova.com/redirect"; const string Q2_ENVIRONMENT = "Sandbox"; + const string Q2_QBO_BASE_URL = "https://sandbox-quickbooks.api.intuit.com/"; const double Q2_TOKEN_LIFESPAN_MINUTES = 45;//Minutes to hold on to access token before refreshing. Right now oct 2019 it's one hour lifespan. static string QBOI2_SESSION_TOKEN = ""; public static string ACCESS_TOKEN { get; set; } @@ -413,8 +414,10 @@ namespace AyaNova.PlugIn.QBOI { //used to tie this session to the auth key on our server for fetching later QBOI2_SESSION_TOKEN = RandomInt64().ToString(); + string LicenseId = GlobalEx.GetItem().DigestValue; + //shell out to browser for user to login to QB - System.Diagnostics.Process.Start("https://qboauth.ayanova.com/start/" + QBOI2_SESSION_TOKEN); + System.Diagnostics.Process.Start("https://qboauth.ayanova.com/start/" + QBOI2_SESSION_TOKEN + "/"+ LicenseId); //Open dialog that polls for token repeatedly, there is a delay built into the server @@ -473,7 +476,7 @@ namespace AyaNova.PlugIn.QBOI //' Common setting for both ServiceContexts: SC.IppConfiguration.MinorVersion.Qbo = "23"; - TODO: variableize this: SC.IppConfiguration.BaseUrl.Qbo = "https://sandbox-quickbooks.api.intuit.com/"; + SC.IppConfiguration.BaseUrl.Qbo = Q2_QBO_BASE_URL; //' Serialization Format Json or xml SC.IppConfiguration.Message.Request.SerializationFormat = Intuit.Ipp.Core.Configuration.SerializationFormat.Json;