This commit is contained in:
2019-10-07 19:41:06 +00:00
parent c00fee9f30
commit 56d37f0fd9

View File

@@ -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;