/// <summary> /// Generate a client that connects to one of the standard AvaTax servers /// </summary> /// <param name="appName"></param> /// <param name="appVersion"></param> /// <param name="machineName"></param> /// <param name="environment"></param> public AvaTaxClient(string appName, string appVersion, string machineName, AvaTaxEnvironment environment) { string envUri = null; switch (environment) { case AvaTaxEnvironment.Sandbox: envUri = Constants.AVATAX_SANDBOX_URL; break; case AvaTaxEnvironment.Production: envUri = Constants.AVATAX_PRODUCTION_URL; break; default: throw new Exception("Unrecognized Environment"); } SetupClient(appName, appVersion, machineName, new Uri(envUri)); }
/// <summary> /// Generate a client that connects to one of the standard AvaTax servers /// </summary> /// <param name="appName"></param> /// <param name="appVersion"></param> /// <param name="machineName"></param> /// <param name="environment"></param> public AvaTaxClient(string appName, string appVersion, string machineName, AvaTaxEnvironment environment) { // Redo the client identifier WithClientIdentifier(appName, appVersion, machineName); // Setup the URI switch (environment) { case AvaTaxEnvironment.Sandbox: _envUri = new Uri(Constants.AVATAX_SANDBOX_URL); break; case AvaTaxEnvironment.Production: _envUri = new Uri(Constants.AVATAX_PRODUCTION_URL); break; default: throw new Exception("Unrecognized Environment"); } }