Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save angelovstanton/4c2e010d5d056d0ed960 to your computer and use it in GitHub Desktop.
Save angelovstanton/4c2e010d5d056d0ed960 to your computer and use it in GitHub Desktop.
public class VatTaxOrderValidationStrategy : IOrderValidationStrategy
{
public VatTaxOrderValidationStrategy()
{
this.VatTaxCalculationService = new VatTaxCalculationService();
}
public VatTaxCalculationService VatTaxCalculationService { get; set; }
public void ValidateOrderSummary(string itemsPrice, ClientPurchaseInfo clientPurchaseInfo)
{
Countries currentCountry = (Countries)Enum.Parse(typeof(Countries), clientPurchaseInfo.Country);
decimal currentItemPrice = decimal.Parse(itemsPrice);
decimal vatTax = this.VatTaxCalculationService.Calculate(currentItemPrice, currentCountry);
PlaceOrderPage.Instance.Validate().EstimatedTaxPrice(vatTax.ToString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment