/// <summary> /// Create new instance with access to customer's currency preference. /// </summary> public CurrencyHandler(ICurrencyPreferenceProvider currencyPreferenceProvider) { if (currencyPreferenceProvider == null) { throw new ArgumentNullException("currencyPreferenceProvider"); } this.currencyPreferenceProvider = currencyPreferenceProvider; }
/// <summary> /// Construct a new instance of CartPricingProvider /// </summary> public CartPricingProvider( IResellerProvider resellerProvider, ICurrencyPreferenceProvider currencyPreferenceProvider, ICountryProvider countryProvider, IContactDataProvider contactDataProvider, RenewalPeriodProvider renewalPeriodProvider, IVatDisplayPreferenceProvider vatDisplayPreferenceProvider, PublicBillingApiProxy billingApi, IVatNumberValidator vatNumberValidator) : base(billingApi) { if (resellerProvider == null) { throw new ArgumentNullException("resellerProvider"); } if (currencyPreferenceProvider == null) { throw new ArgumentNullException("currencyPreferenceProvider"); } if (countryProvider == null) { throw new ArgumentNullException("countryProvider"); } if (contactDataProvider == null) { throw new ArgumentNullException("contactDataProvider"); } if (renewalPeriodProvider == null) { throw new ArgumentNullException("renewalPeriodProvider"); } if (vatDisplayPreferenceProvider == null) { throw new ArgumentNullException("vatDisplayPreferenceProvider"); } if (vatNumberValidator == null) { throw new ArgumentNullException("vatNumberValidator"); } this.resellerProvider = resellerProvider; this.currencyPreferenceProvider = currencyPreferenceProvider; this.countryProvider = countryProvider; this.contactDataProvider = contactDataProvider; this.renewalPeriodProvider = renewalPeriodProvider; this.pricesIncludeVat = vatDisplayPreferenceProvider.ShowPricesIncludingVat(); this.inclusiveTaxCalculationType = resellerProvider.GetReseller().InclusiveTaxCalculationType; this.vatNumberValidator = vatNumberValidator; }
/// <summary> /// Construct a new instance of CartPricingProvider /// </summary> public CartPricingProvider( IResellerProvider resellerProvider, ICurrencyPreferenceProvider currencyPreferenceProvider, ICountryProvider countryProvider, IContactDataProvider contactDataProvider, RenewalPeriodProvider renewalPeriodProvider, IVatDisplayPreferenceProvider vatDisplayPreferenceProvider, PublicBillingApiProxy billingApi) : base(billingApi) { if (resellerProvider == null) { throw new ArgumentNullException("resellerProvider"); } if (currencyPreferenceProvider == null) { throw new ArgumentNullException("currencyPreferenceProvider"); } if (countryProvider == null) { throw new ArgumentNullException("countryProvider"); } if (contactDataProvider == null) { throw new ArgumentNullException("contactDataProvider"); } if (renewalPeriodProvider == null) { throw new ArgumentNullException("renewalPeriodProvider"); } if (vatDisplayPreferenceProvider == null) { throw new ArgumentNullException("vatDisplayPreferenceProvider"); } this.resellerProvider = resellerProvider; this.currencyPreferenceProvider = currencyPreferenceProvider; this.countryProvider = countryProvider; this.contactDataProvider = contactDataProvider; this.renewalPeriodProvider = renewalPeriodProvider; this.pricesIncludeVat = vatDisplayPreferenceProvider.ShowPricesIncludingVat(); this.inclusiveTaxCalculationType = resellerProvider.GetReseller().InclusiveTaxCalculationType; }
/// <summary> /// Construct a new instance /// </summary> public DomainsProvider( IResellerDataProvider resellerDataProvider, ICurrencyPreferenceProvider currencyPreferenceProvider, ApiProductsProvider apiProductsProvider, ProductMapper productMapper, PublicBillingApiProxy billingApi, IShopNameProvider shopNameProvider) : base(billingApi) { if (resellerDataProvider == null) { throw new ArgumentException("resellerDataProvider"); } if (currencyPreferenceProvider == null) { throw new ArgumentException("currencyPreferenceProvider"); } if (apiProductsProvider == null) { throw new ArgumentNullException("apiProductsProvider"); } if (productMapper == null) { throw new ArgumentNullException("productMapper"); } if (shopNameProvider == null) { throw new ArgumentNullException("shopNameProvider"); } var resellerData = resellerDataProvider.GetResellerAccountData(); this.resellerId = resellerData.Id; this.countryCode = resellerData.DefaultCountry.Code; this.currencyCode = currencyPreferenceProvider.GetCurrentCurrency().Code; this.productMapper = productMapper; this.shopNameProvider = shopNameProvider; this.tldProducts = apiProductsProvider.GetProductsByCategories(new List <string> { "TLD" }); }
/// <summary> /// Construct a new instance /// </summary> public DomainsProvider( IResellerDataProvider resellerDataProvider, ICurrencyPreferenceProvider currencyPreferenceProvider, ApiProductsProvider apiProductsProvider, ProductMapper productMapper, PublicBillingApiProxy billingApi, IShopNameProvider shopNameProvider) : base(billingApi) { if (resellerDataProvider == null) { throw new ArgumentException("resellerDataProvider"); } if (currencyPreferenceProvider == null) { throw new ArgumentException("currencyPreferenceProvider"); } if (apiProductsProvider == null) { throw new ArgumentNullException("apiProductsProvider"); } if (productMapper == null) { throw new ArgumentNullException("productMapper"); } if (shopNameProvider == null) { throw new ArgumentNullException("shopNameProvider"); } var resellerData = resellerDataProvider.GetResellerAccountData(); this.resellerId = resellerData.Id; this.countryCode = resellerData.DefaultCountry.Code; this.currencyCode = currencyPreferenceProvider.GetCurrentCurrency().Code; this.productMapper = productMapper; this.shopNameProvider = shopNameProvider; this.tldProducts = apiProductsProvider.GetProductsByCategories(new List<string> { "TLD" }); }
public ProductMapper(ILanguagePreferenceProvider languagePreferenceProvider, ICurrencyPreferenceProvider currencyPreferenceProvider, IVatDisplayPreferenceProvider vatDisplayPreferenceProvider, IResellerProvider resellerProvider) { if (languagePreferenceProvider == null) { throw new ArgumentNullException("languagePreferenceProvider"); } if (currencyPreferenceProvider == null) { throw new ArgumentNullException("currencyPreferenceProvider"); } if (vatDisplayPreferenceProvider == null) { throw new ArgumentNullException("vatDisplayPreferenceProvider"); } this.language = languagePreferenceProvider.GetCurrentLanguage(); this.currencyCode = currencyPreferenceProvider.GetCurrentCurrency().Code; this.pricesIncludeVat = vatDisplayPreferenceProvider.ShowPricesIncludingVat(); this.inclusiveTaxCalculationType = resellerProvider.GetReseller().InclusiveTaxCalculationType; }