/// <summary> /// This method adds a tax rule associated with a zip code pattern. /// </summary> /// <param name="ZipPattern">The zip pattern.</param> /// <param name="TaxRate">The tax rate associated with a tax rule. Tax rates /// are expressed as decimal values. For example, a value of 0.0825 /// specifies a tax rate of 8.25%.</param> public void AddZipTaxRule(string ZipPattern, double TaxRate) { if (!CheckoutShoppingCartRequest.IsValidZipPattern(ZipPattern)) { throw new ApplicationException( CheckoutShoppingCartRequest.ZIP_CODE_PATTERN_EXCEPTION ); } AutoGen.AlternateTaxRule rule = new AutoGen.AlternateTaxRule(); rule.rateSpecified = true; rule.rate = TaxRate; rule.taxarea = new AutoGen.AlternateTaxRuleTaxarea(); AutoGen.USZipArea Area = new AutoGen.USZipArea(); rule.taxarea.Item = Area; Area.zippattern = ZipPattern; _taxRules.Add(rule); }