### Setup Intuit Anywhere SDK Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/SetupTag.txt Use this JavaScript function to configure the grant URL and blue Dot menu URL. This setup is necessary for the 'Connect to QuickBooks' button and the 'blue dot' menu functionality. ```javascript intuit.ipp.anywhere.setup({ grantUrl: '<%= Request.Url.GetLeftPart(UriPartial.Authority) + "/" + System.Configuration.ConfigurationManager.AppSettings["grantUrl"].ToString() %>', menuProxy: '<%= Request.Url.GetLeftPart(UriPartial.Authority) + "/" + System.Configuration.ConfigurationManager.AppSettings["menuProxy"].ToString() %>' }); ``` -------------------------------- ### Setup Intuit Anywhere SDK Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/MVCContent/SetupTag.txt Use this JavaScript code to configure the menu proxy and grant URLs. This is essential for the 'Connect to QuickBooks' button and the 'blue dot' menu functionality. ```C# string MenuProxy = Request.Url.GetLeftPart(UriPartial.Authority) + "/" + System.Configuration.ConfigurationManager.AppSettings["menuProxy"].ToString(); string OauthGrant = Request.Url.GetLeftPart(UriPartial.Authority) + "/" + System.Configuration.ConfigurationManager.AppSettings["grantUrl"].ToString(); ``` ```JavaScript intuit.ipp.anywhere.setup({ menuProxy: '@MenuProxy', grantUrl: '@OauthGrant' }); ``` -------------------------------- ### Setup Intuit Anywhere Grant and Menu URLs in ASP.NET Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/ASPNETContent/SetupTag.txt This JavaScript function is used to set up the grant URL and the 'blue dot' menu URL. This configuration is essential for the 'Connect to QuickBooks' button and the 'blue dot' menu functionality. It dynamically constructs these URLs using server-side C# within an ASP.NET application. ```javascript intuit.ipp.anywhere.setup({ menuProxy:'<%= Request.Url.GetLeftPart(UriPartial.Authority) + "/" + ConfigurationManager.AppSettings["menuProxy"].ToString() %>', grantUrl: '<%= Request.Url.GetLeftPart(UriPartial.Authority) + "/" + ConfigurationManager.AppSettings["grantUrl"].ToString() %>' }); ``` -------------------------------- ### Define Intuit Configuration Section Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Core.Test/Intuit Config Section.txt Include this section in your application's configuration file (app.config or web.config) to define the Intuit configuration structure. This allows Intellisense to provide suggestions for Intuit-specific settings. ```xml
``` -------------------------------- ### Intuit Configuration Section Usage Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Core.Test/Intuit Config Section.txt Once the configuration section is defined, you can use Intellisense to add the intuit section and its sub-elements to your configuration file. ```xml ...... ``` -------------------------------- ### Initiate Direct Connect to Intuit OAuth Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/ASPNETContent/DirectConnectToIntuitTag.txt Call this JavaScript function to begin the 3-legged OAuth process for connecting to Intuit Anywhere. Ensure the Intuit Anywhere JavaScript library is loaded before invoking this function. ```javascript intuit.ipp.anywhere.directConnectToIntuit(); ``` -------------------------------- ### Enable Serilogger Logs for QBO API Calls Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/README.md Configure Serilogger logs for QBO API calls via the ServiceContext. Custom loggers can be assigned to 'CustomLogger'. Enable specific Serilog sinks for file, console, trace, or debug logging, and specify the file location. ```csharp ServiceContext context = new ServiceContext(dictionary["realmId"], IntuitServicesType.QBO, oauthValidator); //Adding support for custom logger where value can be an instance of Serilog.Core.ILogger context.IppConfiguration.AdvancedLogger.RequestAdvancedLog.CustomLogger = ; //Already supported logger in the SDK. Either use custom logger or the below statements for serilog logs to work. context.IppConfiguration.AdvancedLogger.RequestAdvancedLog.EnableSerilogRequestResponseLoggingForFile = true; context.IppConfiguration.AdvancedLogger.RequestAdvancedLog.EnableSerilogRequestResponseLoggingForConsole = true; context.IppConfiguration.AdvancedLogger.RequestAdvancedLog.EnableSerilogRequestResponseLoggingForTrace = true; context.IppConfiguration.AdvancedLogger.RequestAdvancedLog.EnableSerilogRequestResponseLoggingForDebug = true; context.IppConfiguration.AdvancedLogger.RequestAdvancedLog.ServiceRequestLoggingLocationForFile = @"C:\\Documents\\Serilog_log"; //Any drive logging location ``` -------------------------------- ### Map Direct Connect Route Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/MVCContent/directConnectToIntuit.txt Defines a route named 'DirectConnectToIntuit' for handling direct connections to Intuit. This route maps URLs to the 'DirectConnectToIntuit' controller and defaults to the 'Index' action. ```C# routes.MapRoute( "DirectConnectToIntuit", // Route name "{controller}", // URL with parameters new { controller = "DirectConnectToIntuit", action = "Index" } // Parameter defaults ); ``` -------------------------------- ### Add Intuit Config Section Association Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Core.Test/Intuit Config Section.txt Add this XML element to your Visual Studio's catalog.xml file to associate the .config extension with the ippconfig.xsd schema. This enables Intellisense for Intuit configurations. ```xml ``` -------------------------------- ### Enable Old File Based Logs Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/README.md Enable traditional file-based request and response logging for the ServiceContext. Specify the directory where log files should be saved. ```csharp context.IppConfiguration.Logger.RequestLog.EnableRequestResponseLogging = true; context.IppConfiguration.Logger.RequestLog.ServiceRequestLoggingLocation = @"C:\\Documents\\Serilog_log"; //Any drive logging location ``` -------------------------------- ### Enable Serilogger Logs for OAuth2PlatformClient Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/README.md Configure Serilogger logs for OAuth2PlatformClient. Set 'EnableAdvancedLoggerInfoMode' to control log detail. Custom loggers can be assigned to 'CustomLogger'. Enable specific Serilog sinks for console, debug, file, or trace logging. ```csharp static OAuth2Client oauthClient = new OAuth2Client(clientID, clientSecret, redirectURI, appEnvironment); //Use this line to enable only intuit-tid based logs, no tokens/response will be logged. //If set to false, all detailed logs will be available for response //If set to true, only intuit-tid response headers will be available // This will work with both custom logger or already supported serilog logger sinks in the SDK oauthClient.EnableAdvancedLoggerInfoMode = true; // Option for devs to use this for setting their own custom logger //Adding support for custom logger where value can be an instance of Serilog.Core.ILogger oauthClient.CustomLogger = ; //Already supported logger in the SDK. Either use custom logger or the below statements for serilog logs to work. oauthClient.EnableSerilogRequestResponseLoggingForConsole = true; oauthClient.EnableSerilogRequestResponseLoggingForDebug = true; oauthClient.EnableSerilogRequestResponseLoggingForFile = true; oauthClient.EnableSerilogRequestResponseLoggingForTrace = true; oauthClient.ServiceRequestLoggingLocationForFile = @"C:\\Documents\\Serilog_log";//Any drive logging location ``` -------------------------------- ### Configure OAuth Response Route Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/MVCContent/oAuth.txt Maps the URL to the OauthResponse controller. Use this for handling OAuth callback responses. ```C# routes.MapRoute( "OauthResponse", // Route name "{controller}", // URL with parameters new { controller = "OauthResponse" } // Parameter defaults ); ``` -------------------------------- ### Configure OAuth Grant Route Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/MVCContent/oAuth.txt Maps the URL to the OauthGrant controller. Use this for handling OAuth authorization requests. ```C# routes.MapRoute( "OauthGrant", // Route name "{controller}", // URL with parameters new { controller = "OauthGrant" } // Parameter defaults ); ``` -------------------------------- ### Map MVC Route for MenuProxy Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/MVCContent/blueDot.txt Configures a route named 'MenuProxy' for MVC applications. This route maps URLs to the 'MenuProxy' controller by default. ```csharp routes.MapRoute( "MenuProxy", // Route name "{controller}", // URL with parameters new { controller = "MenuProxy" } // Parameter defaults ); ``` -------------------------------- ### HTML Link for Disconnection Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/ASPNETContent/DisconnectTag.txt This HTML link triggers the JavaScript confirmation function when clicked, allowing the user to disconnect from QuickBooks. ```html Disconnect from QuickBooks ``` -------------------------------- ### Configure Logout Route Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/MVCContent/logout.txt Defines a route named 'Logout' that maps URLs to the Logout controller's Index action. This is typically used for handling user sign-out processes. ```C# routes.MapRoute( "Logout", // Route name "{controller}", // URL with parameters new { controller = "Logout", action = "Index" } // Parameter defaults ); ``` -------------------------------- ### Configure Disconnect Route Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/MVCContent/disconnect.txt Defines a route named 'Disconnect' that maps to the 'Disconnect' controller and its 'Index' action. This is typically used for handling user disconnection or logout processes. ```csharp routes.MapRoute( "Disconnect", // Route name "{controller}", // URL with parameters new { controller = "Disconnect", action = "Index" } // Parameter defaults ); ``` -------------------------------- ### Map OpenID Route Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/MVCContent/openID.txt Defines a route for handling OpenID related requests in an MVC application. This route is configured to map requests to the 'OpenId' controller and its actions. ```C# routes.MapRoute( "OpenId", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "OpenId", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); ``` -------------------------------- ### JavaScript Confirmation for Disconnection Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/ASPNETContent/DisconnectTag.txt Use this JavaScript function to display a confirmation alert to the user before they disconnect. This helps prevent accidental disconnections. ```javascript function confirmPost(url) { var agree = confirm("You will no longer be able to access Quickbooks data. Continue?"); if (agree) window.location = url; else return false; } ``` -------------------------------- ### HTML Link for Disconnection Source: https://github.com/intuit/quickbooks-v3-dotnet-sdk/blob/master/Installer/WindowsAzureSDKforIntuitAnywhereInstaller/IntuitAnywhere/CodeFiles/MVCContent/DisconnectTag.txt This HTML anchor tag, when clicked, triggers the JavaScript confirmation function before navigating to the disconnect URL. ```html Disconnect from QuickBooks ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.