This commit is contained in:
@@ -212,6 +212,12 @@
|
|||||||
<Compile Include="AyaMapDetails.cs">
|
<Compile Include="AyaMapDetails.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="GetToken.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="GetToken.Designer.cs">
|
||||||
|
<DependentUpon>GetToken.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="SetAYImportPartVendor.cs">
|
<Compile Include="SetAYImportPartVendor.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -357,6 +363,9 @@
|
|||||||
<DependentUpon>AyaMapDetails.cs</DependentUpon>
|
<DependentUpon>AyaMapDetails.cs</DependentUpon>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="GetToken.resx">
|
||||||
|
<DependentUpon>GetToken.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="SetAYImportPartVendor.resx">
|
<EmbeddedResource Include="SetAYImportPartVendor.resx">
|
||||||
<DependentUpon>SetAYImportPartVendor.cs</DependentUpon>
|
<DependentUpon>SetAYImportPartVendor.cs</DependentUpon>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|||||||
@@ -367,13 +367,24 @@ namespace AyaNova.PlugIn.QBOI
|
|||||||
//case 3671
|
//case 3671
|
||||||
//Modify the below code to instead work with a static tokens obtained from qBridge (just for initial testing)
|
//Modify the below code to instead work with a static tokens obtained from qBridge (just for initial testing)
|
||||||
//then test that all ops work witha fresh company connection
|
//then test that all ops work witha fresh company connection
|
||||||
static public void StartAuthorization()
|
static public bool StartAuthorization()
|
||||||
{
|
{
|
||||||
//used to tie this session to the auth key on our server for fetching later
|
//used to tie this session to the auth key on our server for fetching later
|
||||||
QBOI2_SESSION_TOKEN = RandomInt64().ToString();
|
QBOI2_SESSION_TOKEN = RandomInt64().ToString();
|
||||||
//shell out to browser for user to login to QB
|
//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);
|
||||||
|
|
||||||
|
|
||||||
|
//Open dialog that polls for token repeatedly, there is a delay built into the server
|
||||||
|
//so no need to delay here, just keep attempting to fetch over and over or until cancel
|
||||||
|
GetToken gt = new GetToken(QBOI2_SESSION_TOKEN);
|
||||||
|
DialogResult tokenResult=gt.ShowDialog();
|
||||||
|
if (tokenResult == DialogResult.Cancel)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//LOOP over and over every 5 seconds checking repeatedly for the state token to get off the server or until user selects quit in some dialog that needs to be shown here
|
//LOOP over and over every 5 seconds checking repeatedly for the state token to get off the server or until user selects quit in some dialog that needs to be shown here
|
||||||
|
|
||||||
|
|
||||||
@@ -431,7 +442,9 @@ namespace AyaNova.PlugIn.QBOI
|
|||||||
//' For data updates, create DataService:
|
//' For data updates, create DataService:
|
||||||
|
|
||||||
Intuit.Ipp.DataService.DataService loDataService = new Intuit.Ipp.DataService.DataService(SC);
|
Intuit.Ipp.DataService.DataService loDataService = new Intuit.Ipp.DataService.DataService(SC);
|
||||||
|
|
||||||
_AuthenticationCompleted = true;
|
_AuthenticationCompleted = true;
|
||||||
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -522,14 +535,14 @@ namespace AyaNova.PlugIn.QBOI
|
|||||||
if (!_AuthenticationCompleted)
|
if (!_AuthenticationCompleted)
|
||||||
{
|
{
|
||||||
IntegrationLog.Log(QBID, "PFC: Authenticating...");
|
IntegrationLog.Log(QBID, "PFC: Authenticating...");
|
||||||
StartAuthorization();//case 3671
|
if (!StartAuthorization()) {
|
||||||
|
//user cancelled or some other issue, close qboi
|
||||||
|
IntegrationLog.Log(QBID, "PFC: QuickBooks connection not authorized");
|
||||||
|
return pfstat.Cancel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!_AuthenticationCompleted)
|
|
||||||
{
|
|
||||||
//wait for authorization,
|
|
||||||
//TODO: add timeout here
|
|
||||||
}
|
|
||||||
|
|
||||||
IntegrationLog.Log(QBID, "PFC: Authentication completed, validating company data");
|
IntegrationLog.Log(QBID, "PFC: Authentication completed, validating company data");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user