コード例 #1
0
        /// <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;
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
0
        /// <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;
        }
コード例 #4
0
        /// <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;
        }
コード例 #5
0
        /// <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"
            });
        }
コード例 #6
0
        /// <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" });
        }
コード例 #7
0
        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;
        }
コード例 #8
0
        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;
        }