예제 #1
0
 public OrderHistoryViewService(
     IOrderHistoryViewModelFactory orderHistoryViewModelFactory,
     IOrderRepository orderRepository,
     IOrderUrlProvider orderUrlProvider,
     ILookupService lookupService,
     IOrderDetailsViewModelFactory orderDetailsViewModelFactory,
     IImageService imageService,
     IShippingTrackingProviderFactory shippingTrackingProviderFactory,
     ICustomerRepository customerRepository,
     IComposerJsonSerializer composerJsonSerializer,
     ILineItemViewModelFactory lineItemViewModelFactory,
     ICartRepository cartRepository,
     IComposerContext composerContext,
     ICartUrlProvider cartUrlProvider,
     IEditingOrderProvider editingOrderProvider,
     ICheckoutService checkoutService)
 {
     OrderHistoryViewModelFactory = orderHistoryViewModelFactory ?? throw new ArgumentNullException(nameof(orderHistoryViewModelFactory));
     OrderUrlProvider             = orderUrlProvider ?? throw new ArgumentNullException(nameof(orderUrlProvider));
     LookupService   = lookupService ?? throw new ArgumentNullException(nameof(lookupService));
     OrderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository));
     OrderDetailsViewModelFactory = orderDetailsViewModelFactory ?? throw new ArgumentNullException(nameof(orderDetailsViewModelFactory));
     ImageService = imageService ?? throw new ArgumentNullException(nameof(imageService));
     ShippingTrackingProviderFactory = shippingTrackingProviderFactory ?? throw new ArgumentNullException(nameof(shippingTrackingProviderFactory));
     CustomerRepository       = customerRepository ?? throw new ArgumentNullException(nameof(customerRepository));
     ComposerJsonSerializer   = composerJsonSerializer ?? throw new ArgumentNullException(nameof(composerJsonSerializer));
     LineItemViewModelFactory = lineItemViewModelFactory ?? throw new ArgumentNullException(nameof(lineItemViewModelFactory));
     CartRepository           = cartRepository ?? throw new ArgumentNullException(nameof(cartRepository));
     ComposerContext          = composerContext ?? throw new ArgumentNullException(nameof(composerContext));
     CartUrlProvider          = cartUrlProvider ?? throw new ArgumentNullException(nameof(cartUrlProvider));
     EditingOrderProvider     = editingOrderProvider ?? throw new ArgumentNullException(nameof(editingOrderProvider));
     CheckoutService          = checkoutService ?? throw new ArgumentNullException(nameof(checkoutService));
 }
예제 #2
0
 public OrderController(
     IComposerContext composerContext,
     IOrderHistoryViewService orderHistoryViewService,
     IOrderUrlProvider orderUrlProvider)
 {
     OrderHistoryViewService = orderHistoryViewService ?? throw new ArgumentNullException(nameof(orderHistoryViewService));
     OrderUrlProvider        = orderUrlProvider ?? throw new ArgumentNullException(nameof(orderUrlProvider));
     ComposerContext         = composerContext ?? throw new ArgumentNullException(nameof(composerContext));
 }
예제 #3
0
 protected OrderBaseController(
     IComposerContext composerContext,
     IOrderUrlProvider orderUrlProvider,
     IOrderHistoryViewService orderHistoryViewService)
 {
     ComposerContext         = composerContext ?? throw new ArgumentNullException(nameof(composerContext));
     OrderUrlProvider        = orderUrlProvider ?? throw new ArgumentNullException(nameof(orderUrlProvider));
     OrderHistoryViewService = orderHistoryViewService ?? throw new ArgumentNullException(nameof(orderHistoryViewService));
 }
        public OrderHistoryViewService(IOrderHistoryViewModelFactory orderHistoryViewModelFactory,
                                       IOrderRepository orderRepository,
                                       IOrderUrlProvider orderUrlProvider,
                                       ILookupService lookupService,
                                       IOrderDetailsViewModelFactory orderDetailsViewModelFactory,
                                       IImageService imageService,
                                       IShippingTrackingProviderFactory shippingTrackingProviderFactory)
        {
            if (orderHistoryViewModelFactory == null)
            {
                throw new ArgumentNullException("orderHistoryViewModelFactory");
            }
            if (orderUrlProvider == null)
            {
                throw new ArgumentNullException("orderUrlProvider");
            }
            if (lookupService == null)
            {
                throw new ArgumentNullException("lookupService");
            }
            if (orderRepository == null)
            {
                throw new ArgumentNullException("orderRepository");
            }
            if (orderUrlProvider == null)
            {
                throw new ArgumentNullException("orderUrlProvider");
            }
            if (orderDetailsViewModelFactory == null)
            {
                throw new ArgumentNullException("orderDetailsViewModelFactory");
            }
            if (imageService == null)
            {
                throw new ArgumentNullException("imageService");
            }
            if (shippingTrackingProviderFactory == null)
            {
                throw new ArgumentNullException("shippingTrackingProviderFactory");
            }

            OrderHistoryViewModelFactory = orderHistoryViewModelFactory;
            OrderUrlProvider             = orderUrlProvider;
            LookupService                = lookupService;
            OrderRepository              = orderRepository;
            OrderUrlProvider             = orderUrlProvider;
            OrderDetailsViewModelFactory = orderDetailsViewModelFactory;
            ImageService = imageService;
            ShippingTrackingProviderFactory = shippingTrackingProviderFactory;
        }
예제 #5
0
        /// <summary>
        /// CheckoutService constructor
        /// </summary>
        /// <param name="cartRepository">The repository for accessing cart data</param>
        /// <param name="cartService"></param>
        /// <param name="composerJsonSerializer">The json serializer</param>
        /// <param name="cartViewModelFactory"></param>
        /// <param name="lookupService"></param>
        /// <param name="addressRepository"></param>
        /// <param name="shippingMethodViewService"></param>
        /// <param name="imageService"></param>
        /// <param name="fulfillmentMethodRepository"></param>
        /// <param name="viewModelMapper"></param>
        /// <param name="lineItemViewModelFactory"></param>
        /// <param name="paymentRepository"></param>
        public CheckoutService(
            ICartRepository cartRepository,
            ICartService cartService,
            IComposerJsonSerializer composerJsonSerializer,
            ICartViewModelFactory cartViewModelFactory,
            ILookupService lookupService,
            IAddressRepository addressRepository,
            IShippingMethodViewService shippingMethodViewService,
            IImageService imageService,
            IFulfillmentMethodRepository fulfillmentMethodRepository,
            IViewModelMapper viewModelMapper,
            ILineItemViewModelFactory lineItemViewModelFactory,
            IPaymentRepository paymentRepository,
            IOrderDetailsViewModelFactory orderDetailsViewModelFactory,
            IOrderUrlProvider orderUrlProvider,
            IStoreRepository storeRepository,
            IInventoryLocationProvider inventoryLocationProvider)
        {
            CartRepository               = cartRepository ?? throw new ArgumentNullException(nameof(cartRepository));
            CartService                  = cartService ?? throw new ArgumentNullException(nameof(cartService));
            ComposerJsonSerializer       = composerJsonSerializer ?? throw new ArgumentNullException(nameof(composerJsonSerializer));
            CartViewModelFactory         = cartViewModelFactory ?? throw new ArgumentNullException(nameof(cartViewModelFactory));
            LookupService                = lookupService ?? throw new ArgumentNullException(nameof(lookupService));
            AddressRepository            = addressRepository ?? throw new ArgumentNullException(nameof(addressRepository));
            ShippingMethodViewService    = shippingMethodViewService ?? throw new ArgumentNullException(nameof(shippingMethodViewService));
            ImageService                 = imageService ?? throw new ArgumentNullException(nameof(imageService));
            FulfillmentMethodRepository  = fulfillmentMethodRepository ?? throw new ArgumentNullException(nameof(fulfillmentMethodRepository));
            ViewModelMapper              = viewModelMapper ?? throw new ArgumentNullException(nameof(viewModelMapper));
            LineItemViewModelFactory     = lineItemViewModelFactory ?? throw new ArgumentNullException(nameof(lineItemViewModelFactory));
            PaymentRepository            = paymentRepository ?? throw new ArgumentNullException(nameof(paymentRepository));
            OrderDetailsViewModelFactory = orderDetailsViewModelFactory ?? throw new ArgumentNullException(nameof(orderDetailsViewModelFactory));
            OrderUrlProvider             = orderUrlProvider ?? throw new ArgumentNullException(nameof(orderUrlProvider));
            StoreRepository              = storeRepository ?? throw new ArgumentNullException(nameof(storeRepository));
            InventoryLocationProvider    = inventoryLocationProvider ?? throw new ArgumentNullException(nameof(inventoryLocationProvider));

            _updateOperations = new Dictionary <string, UpdateOperation>();

            RegisterCartUpdateOperation <AddressViewModel>("ShippingAddress", UpdateShippingAddress, 1);
            RegisterCartUpdateOperation <RegisteredShippingAddressViewModel>("ShippingAddressRegistered", UpdateRegisteredShippingAddress, 1);
            RegisterCartUpdateOperation <PickUpAddressViewModel>("PickUpAddress", UpdatePickUpAddress, 1);
            RegisterCartUpdateOperation <CustomerSummaryViewModel>("GuestCustomerInfo", UpdateCustomer, 2);
            RegisterCartUpdateOperation <BillingAddressViewModel>("BillingAddress", UpdateBillingAddress, 3);
            RegisterCartUpdateOperation <RegisteredBillingAddressViewModel>("BillingAddressRegistered", UpdateRegisteredBillingAddress, 3);
            RegisterCartUpdateOperation <ShippingMethodViewModel>("ShippingMethod", UpdateShippingMethod, 4);
        }
        public OrderController(
            IComposerContext composerContext,
            IOrderHistoryViewService orderHistoryViewService,
            IOrderUrlProvider orderUrlProvider)
        {
            if (orderHistoryViewService == null)
            {
                throw new ArgumentNullException("orderHistoryViewService");
            }
            if (composerContext == null)
            {
                throw new ArgumentNullException("composerContext");
            }

            OrderHistoryViewService = orderHistoryViewService;
            OrderUrlProvider        = orderUrlProvider;
            ComposerContext         = composerContext;
        }
 public OrderHistoryViewService(
     IOrderHistoryViewModelFactory orderHistoryViewModelFactory,
     IOrderRepository orderRepository,
     IOrderUrlProvider orderUrlProvider,
     ILookupService lookupService,
     IOrderDetailsViewModelFactory orderDetailsViewModelFactory,
     IImageService imageService,
     IShippingTrackingProviderFactory shippingTrackingProviderFactory,
     ICustomerRepository customerRepository)
 {
     OrderHistoryViewModelFactory = orderHistoryViewModelFactory ?? throw new ArgumentNullException(nameof(orderHistoryViewModelFactory));
     OrderUrlProvider             = orderUrlProvider ?? throw new ArgumentNullException(nameof(orderUrlProvider));
     LookupService   = lookupService ?? throw new ArgumentNullException(nameof(lookupService));
     OrderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository));
     OrderDetailsViewModelFactory = orderDetailsViewModelFactory ?? throw new ArgumentNullException(nameof(orderDetailsViewModelFactory));
     ImageService = imageService ?? throw new ArgumentNullException(nameof(imageService));
     ShippingTrackingProviderFactory = shippingTrackingProviderFactory ?? throw new ArgumentNullException(nameof(shippingTrackingProviderFactory));
     CustomerRepository = customerRepository ?? throw new ArgumentNullException(nameof(customerRepository));
 }
 public MyAccountViewService(
     IComposerContext composerContext,
     IMyAccountUrlProvider myAccountUrlProvider,
     IOrderUrlProvider orderUrlProvider,
     IWishListUrlProvider wishListUrlProvider,
     IRecurringScheduleUrlProvider recurringScheduleUrlProvider,
     IPageService pageService,
     IWebsiteContext websiteContext,
     IRecurringOrdersSettings recurringOrdersSettings,
     ISiteConfiguration siteConfiguration)
 {
     ComposerContext              = composerContext ?? throw new ArgumentNullException(nameof(composerContext));
     MyAccountUrlProvider         = myAccountUrlProvider ?? throw new ArgumentNullException(nameof(myAccountUrlProvider));
     OrderUrlProvider             = orderUrlProvider ?? throw new ArgumentNullException(nameof(orderUrlProvider));
     WishListUrlProvider          = wishListUrlProvider ?? throw new ArgumentNullException(nameof(wishListUrlProvider));
     PageService                  = pageService ?? throw new ArgumentNullException(nameof(pageService));
     RecurringScheduleUrlProvider = recurringScheduleUrlProvider ?? throw new ArgumentNullException(nameof(recurringScheduleUrlProvider));
     WebsiteContext               = websiteContext ?? throw new ArgumentNullException(nameof(websiteContext));
     RecurringOrdersSettings      = recurringOrdersSettings ?? throw new ArgumentNullException(nameof(recurringOrdersSettings));
     SiteConfiguration            = siteConfiguration ?? throw new ArgumentNullException(nameof(siteConfiguration));
 }
예제 #9
0
        protected OrderBaseController(
            IComposerContext composerContext,
            IOrderUrlProvider orderUrlProvider,
            IOrderHistoryViewService orderHistoryViewService)
        {
            if (composerContext == null)
            {
                throw new ArgumentNullException("composerContext");
            }
            if (orderUrlProvider == null)
            {
                throw new ArgumentNullException("orderUrlProvider");
            }
            if (orderHistoryViewService == null)
            {
                throw new ArgumentNullException("orderHistoryViewService");
            }

            ComposerContext         = composerContext;
            OrderUrlProvider        = orderUrlProvider;
            OrderHistoryViewService = orderHistoryViewService;
        }
 public OrderController(IComposerContext composerContext, IOrderUrlProvider orderUrlProvider, IOrderHistoryViewService orderHistoryViewService) : base(composerContext, orderUrlProvider, orderHistoryViewService)
 {
 }