Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save angelovstanton/3094cc470fd813786df3 to your computer and use it in GitHub Desktop.
Save angelovstanton/3094cc470fd813786df3 to your computer and use it in GitHub Desktop.
public class SalesTaxOrderValidationStrategy : IOrderValidationStrategy
{
public SalesTaxOrderValidationStrategy()
{
this.SalesTaxCalculationService = new SalesTaxCalculationService();
}
public SalesTaxCalculationService SalesTaxCalculationService { get; set; }
public void ValidateOrderSummary(string itemsPrice, ClientPurchaseInfo clientPurchaseInfo)
{
States currentState = (States)Enum.Parse(typeof(States), clientPurchaseInfo.State);
decimal currentItemPrice = decimal.Parse(itemsPrice);
decimal salesTax = this.SalesTaxCalculationService.Calculate(currentItemPrice, currentState, clientPurchaseInfo.Zip);
PlaceOrderPage.Instance.Validate().EstimatedTaxPrice(salesTax.ToString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment