/// <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>
        /// Create a new instance of the service.
        /// </summary>
        public OrderPlacementService(
            PaymentUrlProvider urlProvider,
            IProductProvider productProvider,
            RenewalPeriodProvider renewalPeriodProvider,
            IEnumerable<PaymentDataHandler> paymentDataHandlers,
            OrderCreator orderCreator,
            PaymentTransactionCreator paymentTransactionCreator)
        {
            if (urlProvider == null)
            {
                throw new ArgumentNullException("urlProvider");
            }

            if (productProvider == null)
            {
                throw new ArgumentNullException("productProvider");
            }

            if (renewalPeriodProvider == null)
            {
                throw new ArgumentNullException("renewalPeriodProvider");
            }

            if (paymentDataHandlers == null)
            {
                throw new ArgumentNullException("paymentDataHandlers");
            }

            if (orderCreator == null)
            {
                throw new ArgumentNullException("orderCreator");
            }

            if (paymentTransactionCreator == null)
            {
                throw new ArgumentNullException("paymentTransactionCreator");
            }

            this.urlProvider = urlProvider;
            this.productProvider = productProvider;
            this.renewalPeriodProvider = renewalPeriodProvider;
            this.paymentDataHandlers = paymentDataHandlers;
            this.orderCreator = orderCreator;
            this.paymentTransactionCreator = paymentTransactionCreator;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Create a new instance of the service.
        /// </summary>
        public OrderPlacementService(
            PaymentUrlProvider urlProvider,
            IProductProvider productProvider,
            RenewalPeriodProvider renewalPeriodProvider,
            IEnumerable <PaymentDataHandler> paymentDataHandlers,
            OrderCreator orderCreator,
            PaymentTransactionCreator paymentTransactionCreator)
        {
            if (urlProvider == null)
            {
                throw new ArgumentNullException("urlProvider");
            }

            if (productProvider == null)
            {
                throw new ArgumentNullException("productProvider");
            }

            if (renewalPeriodProvider == null)
            {
                throw new ArgumentNullException("renewalPeriodProvider");
            }

            if (paymentDataHandlers == null)
            {
                throw new ArgumentNullException("paymentDataHandlers");
            }

            if (orderCreator == null)
            {
                throw new ArgumentNullException("orderCreator");
            }

            if (paymentTransactionCreator == null)
            {
                throw new ArgumentNullException("paymentTransactionCreator");
            }

            this.urlProvider               = urlProvider;
            this.productProvider           = productProvider;
            this.renewalPeriodProvider     = renewalPeriodProvider;
            this.paymentDataHandlers       = paymentDataHandlers;
            this.orderCreator              = orderCreator;
            this.paymentTransactionCreator = paymentTransactionCreator;
        }