Пример #1
0
 /// <summary>
 /// 获取当前用户的积分信息
 /// </summary>
 /// <param name="customer"></param>
 /// <param name="_rewardService"></param>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <returns></returns>
 public static IPagedResult <RewardPointsHistory> GetCustomerReward(this Customer customer,
                                                                    IRewardPointService _rewardService,
                                                                    int pageIndex = 0,
                                                                    int pageSize  = int.MaxValue)
 {
     return(_rewardService.GetAllPointsHistory(customerId: customer.Id, pageIndex: pageIndex, pageSize: pageSize));
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="workContext">Work context</param>
 /// <param name="storeContext">Store context</param>
 /// <param name="priceCalculationService">Price calculation service</param>
 /// <param name="taxService">Tax service</param>
 /// <param name="shippingService">Shipping service</param>
 /// <param name="paymentService">Payment service</param>
 /// <param name="checkoutAttributeParser">Checkout attribute parser</param>
 /// <param name="discountService">Discount service</param>
 /// <param name="giftCardService">Gift card service</param>
 /// <param name="genericAttributeService">Generic attribute service</param>
 /// <param name="rewardPointService">Reward point service</param>
 /// <param name="taxSettings">Tax settings</param>
 /// <param name="rewardPointsSettings">Reward points settings</param>
 /// <param name="shippingSettings">Shipping settings</param>
 /// <param name="shoppingCartSettings">Shopping cart settings</param>
 /// <param name="catalogSettings">Catalog settings</param>
 public SubscriptionTotalCalculationService(IWorkContext workContext,
                                            IStoreContext storeContext,
                                            IPriceCalculationService priceCalculationService,
                                            ITaxService taxService,
                                            IPaymentService paymentService,
                                            ICheckoutAttributeParser checkoutAttributeParser,
                                            IGenericAttributeService genericAttributeService,
                                            IRewardPointService rewardPointService,
                                            TaxSettings taxSettings,
                                            RewardPointsSettings rewardPointsSettings,
                                            ShoppingCartSettings shoppingCartSettings,
                                            CatalogSettings catalogSettings)
 {
     this._workContext             = workContext;
     this._storeContext            = storeContext;
     this._priceCalculationService = priceCalculationService;
     this._taxService              = taxService;
     this._paymentService          = paymentService;
     this._checkoutAttributeParser = checkoutAttributeParser;
     this._genericAttributeService = genericAttributeService;
     this._rewardPointService      = rewardPointService;
     this._taxSettings             = taxSettings;
     this._rewardPointsSettings    = rewardPointsSettings;
     this._shoppingCartSettings    = shoppingCartSettings;
     this._catalogSettings         = catalogSettings;
 }
Пример #3
0
 public CustomerRegistrationService(CustomerSettings customerSettings,
                                    ICustomerService customerService,
                                    IEncryptionService encryptionService,
                                    IEventPublisher eventPublisher,
                                    IGenericAttributeService genericAttributeService,
                                    ILocalizationService localizationService,
                                    INewsLetterSubscriptionService newsLetterSubscriptionService,
                                    IRewardPointService rewardPointService,
                                    IStoreService storeService,
                                    IWorkContext workContext,
                                    IWorkflowMessageService workflowMessageService,
                                    RewardPointsSettings rewardPointsSettings)
 {
     _customerSettings              = customerSettings;
     _customerService               = customerService;
     _encryptionService             = encryptionService;
     _eventPublisher                = eventPublisher;
     _genericAttributeService       = genericAttributeService;
     _localizationService           = localizationService;
     _newsLetterSubscriptionService = newsLetterSubscriptionService;
     _rewardPointService            = rewardPointService;
     _storeService           = storeService;
     _workContext            = workContext;
     _workflowMessageService = workflowMessageService;
     _rewardPointsSettings   = rewardPointsSettings;
 }
Пример #4
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="workContext">Work context</param>
 /// <param name="storeContext">Store context</param>
 /// <param name="priceCalculationService">Price calculation service</param>
 /// <param name="taxService">Tax service</param>
 /// <param name="shippingService">Shipping service</param>
 /// <param name="paymentService">Payment service</param>
 /// <param name="checkoutAttributeParser">Checkout attribute parser</param>
 /// <param name="discountService">Discount service</param>
 /// <param name="giftCardService">Gift card service</param>
 /// <param name="genericAttributeService">Generic attribute service</param>
 /// <param name="rewardPointService">Reward point service</param>
 /// <param name="taxSettings">Tax settings</param>
 /// <param name="rewardPointsSettings">Reward points settings</param>
 /// <param name="shippingSettings">Shipping settings</param>
 /// <param name="shoppingCartSettings">Shopping cart settings</param>
 /// <param name="catalogSettings">Catalog settings</param>
 public OrderTotalCalculationService(IWorkContext workContext,
     IStoreContext storeContext,
     IPriceCalculationService priceCalculationService,
     ITaxService taxService,
     IShippingService shippingService,
     IPaymentService paymentService,
     ICheckoutAttributeParser checkoutAttributeParser,
     IDiscountService discountService,
     IGiftCardService giftCardService,
     IGenericAttributeService genericAttributeService,
     IRewardPointService rewardPointService,
     TaxSettings taxSettings,
     RewardPointsSettings rewardPointsSettings,
     ShippingSettings shippingSettings,
     ShoppingCartSettings shoppingCartSettings,
     CatalogSettings catalogSettings)
 {
     this._workContext = workContext;
     this._storeContext = storeContext;
     this._priceCalculationService = priceCalculationService;
     this._taxService = taxService;
     this._shippingService = shippingService;
     this._paymentService = paymentService;
     this._checkoutAttributeParser = checkoutAttributeParser;
     this._discountService = discountService;
     this._giftCardService = giftCardService;
     this._genericAttributeService = genericAttributeService;
     this._rewardPointService = rewardPointService;
     this._taxSettings = taxSettings;
     this._rewardPointsSettings = rewardPointsSettings;
     this._shippingSettings = shippingSettings;
     this._shoppingCartSettings = shoppingCartSettings;
     this._catalogSettings = catalogSettings;
 }
Пример #5
0
 public OrderModelFactory(AddressSettings addressSettings,
                          CatalogSettings catalogSettings,
                          IAddressModelFactory addressModelFactory,
                          IAddressService addressService,
                          ICountryService countryService,
                          ICurrencyService currencyService,
                          ICustomerService customerService,
                          IDateTimeHelper dateTimeHelper,
                          IGiftCardService giftCardService,
                          ILocalizationService localizationService,
                          IOrderProcessingService orderProcessingService,
                          IOrderService orderService,
                          IOrderTotalCalculationService orderTotalCalculationService,
                          IPaymentPluginManager paymentPluginManager,
                          IPaymentService paymentService,
                          IPriceFormatter priceFormatter,
                          IProductService productService,
                          IRewardPointService rewardPointService,
                          IShipmentService shipmentService,
                          IStoreContext storeContext,
                          IUrlRecordService urlRecordService,
                          IVendorService vendorService,
                          IWorkContext workContext,
                          OrderSettings orderSettings,
                          PdfSettings pdfSettings,
                          RewardPointsSettings rewardPointsSettings,
                          ShippingSettings shippingSettings,
                          TaxSettings taxSettings,
                          VendorSettings vendorSettings)
 {
     _addressSettings              = addressSettings;
     _catalogSettings              = catalogSettings;
     _addressModelFactory          = addressModelFactory;
     _addressService               = addressService;
     _countryService               = countryService;
     _currencyService              = currencyService;
     _customerService              = customerService;
     _dateTimeHelper               = dateTimeHelper;
     _giftCardService              = giftCardService;
     _localizationService          = localizationService;
     _orderProcessingService       = orderProcessingService;
     _orderService                 = orderService;
     _orderTotalCalculationService = orderTotalCalculationService;
     _paymentPluginManager         = paymentPluginManager;
     _paymentService               = paymentService;
     _priceFormatter               = priceFormatter;
     _productService               = productService;
     _rewardPointService           = rewardPointService;
     _shipmentService              = shipmentService;
     _storeContext                 = storeContext;
     _urlRecordService             = urlRecordService;
     _vendorService                = vendorService;
     _workContext          = workContext;
     _orderSettings        = orderSettings;
     _pdfSettings          = pdfSettings;
     _rewardPointsSettings = rewardPointsSettings;
     _shippingSettings     = shippingSettings;
     _taxSettings          = taxSettings;
     _vendorSettings       = vendorSettings;
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="customerService">Customer service</param>
 /// <param name="encryptionService">Encryption service</param>
 /// <param name="newsLetterSubscriptionService">Newsletter subscription service</param>
 /// <param name="localizationService">Localization service</param>
 /// <param name="storeService">Store service</param>
 /// <param name="rewardPointsSettings">Reward points settings</param>
 /// <param name="customerSettings">Customer settings</param>
 public CustomerRegistrationService(ICustomerService customerService,
                                    IEncryptionService encryptionService,
                                    INewsLetterSubscriptionService newsLetterSubscriptionService,
                                    ILocalizationService localizationService,
                                    IStoreService storeService,
                                    IRewardPointService rewardPointService,
                                    RewardPointsSettings rewardPointsSettings,
                                    CustomerSettings customerSettings,
                                    IStoreContext storeContext)
     : base(customerService,
            encryptionService,
            newsLetterSubscriptionService,
            localizationService,
            storeService,
            rewardPointService,
            rewardPointsSettings,
            customerSettings)
 {
     this._customerService               = customerService;
     this._encryptionService             = encryptionService;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._localizationService           = localizationService;
     this._storeService         = storeService;
     this._rewardPointsSettings = rewardPointsSettings;
     this._customerSettings     = customerSettings;
     this._storeContext         = storeContext;
 }
Пример #7
0
 public CustomOrderProcessingService(
     IPluginFinder pluginFinder,
     IOrderService orderService, IWebHelper webHelper, ILocalizationService localizationService,
     ILanguageService languageService, IProductService productService, IPaymentService paymentService,
     ILogger logger, IOrderTotalCalculationService orderTotalCalculationService,
     IPriceCalculationService priceCalculationService, IPriceFormatter priceFormatter,
     IProductAttributeParser productAttributeParser, IProductAttributeFormatter productAttributeFormatter,
     IGiftCardService giftCardService, IShoppingCartService shoppingCartService,
     ICheckoutAttributeFormatter checkoutAttributeFormatter, IShippingService shippingService,
     IShipmentService shipmentService, ITaxService taxService, ICustomerService customerService,
     IDiscountService discountService, IEncryptionService encryptionService, IWorkContext workContext,
     IWorkflowMessageService workflowMessageService, IVendorService vendorService,
     ICustomerActivityService customerActivityService, ICurrencyService currencyService,
     IAffiliateService affiliateService, IEventPublisher eventPublisher, IPdfService pdfService,
     IRewardPointService rewardPointService, IGenericAttributeService genericAttributeService,
     ICountryService countryService, ShippingSettings shippingSettings, PaymentSettings paymentSettings,
     RewardPointsSettings rewardPointsSettings, OrderSettings orderSettings, TaxSettings taxSettings,
     LocalizationSettings localizationSettings, CurrencySettings currencySettings) :
     base(orderService, webHelper, localizationService, languageService, productService, paymentService, logger,
          orderTotalCalculationService, priceCalculationService, priceFormatter, productAttributeParser,
          productAttributeFormatter, giftCardService, shoppingCartService, checkoutAttributeFormatter,
          shippingService, shipmentService, taxService, customerService, discountService, encryptionService,
          workContext, workflowMessageService, vendorService, customerActivityService, currencyService,
          affiliateService, eventPublisher, pdfService, rewardPointService, genericAttributeService, countryService,
          shippingSettings, paymentSettings, rewardPointsSettings, orderSettings, taxSettings, localizationSettings, currencySettings)
 {
     _pluginFinder = pluginFinder;
 }
Пример #8
0
 public CheckoutModelFactory(AddressSettings addressSettings,
                             CommonSettings commonSettings,
                             IAddressModelFactory addressModelFactory,
                             IAddressService addressService,
                             ICountryService countryService,
                             ICurrencyService currencyService,
                             ICustomerService customerService,
                             IGenericAttributeService genericAttributeService,
                             ILocalizationService localizationService,
                             IOrderProcessingService orderProcessingService,
                             IOrderTotalCalculationService orderTotalCalculationService,
                             IPaymentPluginManager paymentPluginManager,
                             IPaymentService paymentService,
                             IPickupPluginManager pickupPluginManager,
                             IPriceFormatter priceFormatter,
                             IRewardPointService rewardPointService,
                             IShippingPluginManager shippingPluginManager,
                             IShippingService shippingService,
                             IShoppingCartService shoppingCartService,
                             IStateProvinceService stateProvinceService,
                             IStoreContext storeContext,
                             IStoreMappingService storeMappingService,
                             ITaxService taxService,
                             IWorkContext workContext,
                             OrderSettings orderSettings,
                             PaymentSettings paymentSettings,
                             RewardPointsSettings rewardPointsSettings,
                             ShippingSettings shippingSettings,
                             IDateTimeHelper dateTimeHelper)
 {
     _addressSettings              = addressSettings;
     _commonSettings               = commonSettings;
     _addressModelFactory          = addressModelFactory;
     _addressService               = addressService;
     _countryService               = countryService;
     _currencyService              = currencyService;
     _customerService              = customerService;
     _genericAttributeService      = genericAttributeService;
     _localizationService          = localizationService;
     _orderProcessingService       = orderProcessingService;
     _orderTotalCalculationService = orderTotalCalculationService;
     _paymentPluginManager         = paymentPluginManager;
     _paymentService               = paymentService;
     _pickupPluginManager          = pickupPluginManager;
     _priceFormatter               = priceFormatter;
     _rewardPointService           = rewardPointService;
     _shippingPluginManager        = shippingPluginManager;
     _shippingService              = shippingService;
     _shoppingCartService          = shoppingCartService;
     _stateProvinceService         = stateProvinceService;
     _storeContext         = storeContext;
     _storeMappingService  = storeMappingService;
     _taxService           = taxService;
     _workContext          = workContext;
     _orderSettings        = orderSettings;
     _paymentSettings      = paymentSettings;
     _rewardPointsSettings = rewardPointsSettings;
     _shippingSettings     = shippingSettings;
     _dateTimeHelper       = dateTimeHelper;
 }
 public EventConsumer(ICustomerService customerService,
                      IGenericAttributeService genericAttributeService,
                      IOrderService orderService,
                      IRewardPointService rewardPointService,
                      IStoreContext storeContext,
                      ILocalizationService localizationService,
                      RewardPointsForBlogCommentsSettings rewardPointsSettingsForBlogComments,
                      RewardPointsForFastPurchaseSettings rewardPointsForFastPurchaseSettings,
                      RewardPointsForFirstPurchaseSettings rewardPointsSettingsForFirstPurchase,
                      RewardPointsForNewsCommentsSettings rewardPointsSettingsForNewsComments,
                      RewardPointsForNewsletterSubscriptionsSettings rewardPointsSettingsForNewsletterSubscriptions,
                      RewardPointsForProductReviewsSettings rewardPointsSettingsForProductReviews,
                      RewardPointsForRegistrationSettings rewardPointsForRegistrationSettings)
 {
     this._customerService                                = customerService;
     this._genericAttributeService                        = genericAttributeService;
     this._orderService                                   = orderService;
     this._rewardPointService                             = rewardPointService;
     this._storeContext                                   = storeContext;
     this._localizationService                            = localizationService;
     this._rewardPointsSettingsForBlogComments            = rewardPointsSettingsForBlogComments;
     this._rewardPointsSettingsForFastPurchase            = rewardPointsForFastPurchaseSettings;
     this._rewardPointsSettingsForFirstPurchase           = rewardPointsSettingsForFirstPurchase;
     this._rewardPointsSettingsForNewsComments            = rewardPointsSettingsForNewsComments;
     this._rewardPointsSettingsForNewsletterSubscriptions = rewardPointsSettingsForNewsletterSubscriptions;
     this._rewardPointsSettingsForProductReviews          = rewardPointsSettingsForProductReviews;
     this._rewardPointsForRegistrationSettings            = rewardPointsForRegistrationSettings;
 }
Пример #10
0
 public OrderModelFactory(AddressSettings addressSettings,
                          CatalogSettings catalogSettings,
                          IAddressModelFactory addressModelFactory,
                          IPictureService pictureService,
                          IProductModelFactory productModelFactory,
                          ICountryService countryService,
                          ICurrencyService currencyService,
                          IDateTimeHelper dateTimeHelper,
                          IDownloadService downloadService,
                          ILocalizationService localizationService,
                          IOrderProcessingService orderProcessingService,
                          IOrderService orderService,
                          IOrderTotalCalculationService orderTotalCalculationService,
                          IPaymentService paymentService,
                          IPriceFormatter priceFormatter,
                          IProductService productService,
                          IRewardPointService rewardPointService,
                          IShipmentService shipmentService,
                          IStoreContext storeContext,
                          IUrlRecordService urlRecordService,
                          IVendorService vendorService,
                          IWorkContext workContext,
                          OrderSettings orderSettings,
                          PdfSettings pdfSettings,
                          RewardPointsSettings rewardPointsSettings,
                          ShippingSettings shippingSettings,
                          TaxSettings taxSettings,
                          VendorSettings vendorSettings)
 {
     this._pictureService               = pictureService;
     this._addressSettings              = addressSettings;
     this._catalogSettings              = catalogSettings;
     this._addressModelFactory          = addressModelFactory;
     this._productModelFactory          = productModelFactory;
     this._countryService               = countryService;
     this._currencyService              = currencyService;
     this._dateTimeHelper               = dateTimeHelper;
     this._downloadService              = downloadService;
     this._localizationService          = localizationService;
     this._orderProcessingService       = orderProcessingService;
     this._orderService                 = orderService;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._paymentService               = paymentService;
     this._priceFormatter               = priceFormatter;
     this._productService               = productService;
     this._rewardPointService           = rewardPointService;
     this._shipmentService              = shipmentService;
     this._storeContext                 = storeContext;
     this._urlRecordService             = urlRecordService;
     this._vendorService                = vendorService;
     this._workContext          = workContext;
     this._orderSettings        = orderSettings;
     this._pdfSettings          = pdfSettings;
     this._rewardPointsSettings = rewardPointsSettings;
     this._shippingSettings     = shippingSettings;
     this._taxSettings          = taxSettings;
     this._vendorSettings       = vendorSettings;
 }
        public CustomOrderTotalCalculationService(CatalogSettings catalogSettings,
                                                  IAddressService addressService,
                                                  ICheckoutAttributeParser checkoutAttributeParser,
                                                  ICustomerService customerService,
                                                  IDiscountService discountService,
                                                  IGenericAttributeService genericAttributeService,
                                                  IGiftCardService giftCardService,
                                                  IOrderService orderService,
                                                  IPaymentService paymentService,
                                                  IPriceCalculationService priceCalculationService,
                                                  IProductService productService,
                                                  IRewardPointService rewardPointService,
                                                  IShippingPluginManager shippingPluginManager,
                                                  IShippingService shippingService,
                                                  IShoppingCartService shoppingCartService,
                                                  IStoreContext storeContext,
                                                  ITaxService taxService,
                                                  IWorkContext workContext,
                                                  RewardPointsSettings rewardPointsSettings,
                                                  ShippingSettings shippingSettings,
                                                  ShoppingCartSettings shoppingCartSettings,
                                                  TaxSettings taxSettings,
                                                  // custom
                                                  IWarrantyTaxService warrantyTaxService
                                                  )
            : base(catalogSettings, addressService, checkoutAttributeParser, customerService,
                   discountService, genericAttributeService, giftCardService, orderService,
                   paymentService, priceCalculationService, productService, rewardPointService,
                   shippingPluginManager, shippingService, shoppingCartService,
                   storeContext, taxService, workContext, rewardPointsSettings,
                   shippingSettings, shoppingCartSettings, taxSettings)
        {
            _catalogSettings         = catalogSettings;
            _addressService          = addressService;
            _checkoutAttributeParser = checkoutAttributeParser;
            _customerService         = customerService;
            _discountService         = discountService;
            _genericAttributeService = genericAttributeService;
            _giftCardService         = giftCardService;
            _orderService            = orderService;
            _paymentService          = paymentService;
            _priceCalculationService = priceCalculationService;
            _productService          = productService;
            _rewardPointService      = rewardPointService;
            _shippingPluginManager   = shippingPluginManager;
            _shippingService         = shippingService;
            _shoppingCartService     = shoppingCartService;
            _storeContext            = storeContext;
            _taxService           = taxService;
            _workContext          = workContext;
            _rewardPointsSettings = rewardPointsSettings;
            _shippingSettings     = shippingSettings;
            _shoppingCartSettings = shoppingCartSettings;
            _taxSettings          = taxSettings;

            // custom
            _warrantyTaxService = warrantyTaxService;
        }
 public OverriddenOrderTotalCalculationService(CatalogSettings catalogSettings,
                                               IAddressService addressService,
                                               ICheckoutAttributeParser checkoutAttributeParser,
                                               ICustomerService customerSercice,
                                               IDiscountService discountService,
                                               IGenericAttributeService genericAttributeService,
                                               IGiftCardService giftCardService,
                                               IOrderService orderService,
                                               IHttpContextAccessor httpContextAccessor,
                                               IPaymentService paymentService,
                                               IPriceCalculationService priceCalculationService,
                                               IProductService productService,
                                               IRewardPointService rewardPointService,
                                               IShippingPluginManager shippingPluginManager,
                                               IShippingService shippingService,
                                               IShoppingCartService shoppingCartService,
                                               IStoreContext storeContext,
                                               ITaxService taxService,
                                               IWorkContext workContext,
                                               RewardPointsSettings rewardPointsSettings,
                                               ShippingSettings shippingSettings,
                                               ShoppingCartSettings shoppingCartSettings,
                                               TaxSettings taxSettings) : base(catalogSettings,
                                                                               addressService,
                                                                               checkoutAttributeParser,
                                                                               customerSercice,
                                                                               discountService,
                                                                               genericAttributeService,
                                                                               giftCardService,
                                                                               orderService,
                                                                               paymentService,
                                                                               priceCalculationService,
                                                                               productService,
                                                                               rewardPointService,
                                                                               shippingPluginManager,
                                                                               shippingService,
                                                                               shoppingCartService,
                                                                               storeContext,
                                                                               taxService,
                                                                               workContext,
                                                                               rewardPointsSettings,
                                                                               shippingSettings,
                                                                               shoppingCartSettings,
                                                                               taxSettings)
 {
     _genericAttributeService = genericAttributeService;
     _httpContextAccessor     = httpContextAccessor;
     _paymentService          = paymentService;
     _priceCalculationService = priceCalculationService;
     _shippingPluginManager   = shippingPluginManager;
     _customerService         = customerSercice;
     _storeContext            = storeContext;
     _taxService           = taxService;
     _workContext          = workContext;
     _shoppingCartSettings = shoppingCartSettings;
 }
Пример #13
0
 public OrderSummaryViewComponent(IShoppingCartModelFactory shoppingCartModelFactory,
                                  IStoreContext storeContext,
                                  IWorkContext workContext,
                                  IRewardPointService rewardPointService)
 {
     this._shoppingCartModelFactory = shoppingCartModelFactory;
     this._storeContext             = storeContext;
     this._workContext        = workContext;
     this._rewardPointService = rewardPointService;
 }
Пример #14
0
        public OrderController(IOrderService orderService, 
            IShipmentService shipmentService, 
            IWorkContext workContext,
            ICurrencyService currencyService,
            IPriceFormatter priceFormatter,
            IOrderProcessingService orderProcessingService, 
            IDateTimeHelper dateTimeHelper,
            IPaymentService paymentService, 
            ILocalizationService localizationService,
            IPdfService pdfService, 
            IShippingService shippingService,
            ICountryService countryService, 
            IProductAttributeParser productAttributeParser,
            IWebHelper webHelper,
            IDownloadService downloadService,
            IAddressAttributeFormatter addressAttributeFormatter,
            IStoreContext storeContext,
            IOrderTotalCalculationService orderTotalCalculationService,
            IRewardPointService rewardPointService,
            CatalogSettings catalogSettings,
            OrderSettings orderSettings,
            TaxSettings taxSettings,
            ShippingSettings shippingSettings, 
            AddressSettings addressSettings,
            RewardPointsSettings rewardPointsSettings,
            PdfSettings pdfSettings)
        {
            this._orderService = orderService;
            this._shipmentService = shipmentService;
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._dateTimeHelper = dateTimeHelper;
            this._paymentService = paymentService;
            this._localizationService = localizationService;
            this._pdfService = pdfService;
            this._shippingService = shippingService;
            this._countryService = countryService;
            this._productAttributeParser = productAttributeParser;
            this._webHelper = webHelper;
            this._downloadService = downloadService;
            this._addressAttributeFormatter = addressAttributeFormatter;
            this._storeContext = storeContext;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._rewardPointService = rewardPointService;

            this._catalogSettings = catalogSettings;
            this._orderSettings = orderSettings;
            this._taxSettings = taxSettings;
            this._shippingSettings = shippingSettings;
            this._addressSettings = addressSettings;
            this._rewardPointsSettings = rewardPointsSettings;
            this._pdfSettings = pdfSettings;
        }
Пример #15
0
        public OrderController(IOrderService orderService,
                               IShipmentService shipmentService,
                               IWorkContext workContext,
                               ICurrencyService currencyService,
                               IPriceFormatter priceFormatter,
                               IOrderProcessingService orderProcessingService,
                               IDateTimeHelper dateTimeHelper,
                               IPaymentService paymentService,
                               ILocalizationService localizationService,
                               IPdfService pdfService,
                               IShippingService shippingService,
                               ICountryService countryService,
                               IProductAttributeParser productAttributeParser,
                               IWebHelper webHelper,
                               IDownloadService downloadService,
                               IAddressAttributeFormatter addressAttributeFormatter,
                               IStoreContext storeContext,
                               IOrderTotalCalculationService orderTotalCalculationService,
                               IRewardPointService rewardPointService,
                               CatalogSettings catalogSettings,
                               OrderSettings orderSettings,
                               TaxSettings taxSettings,
                               ShippingSettings shippingSettings,
                               AddressSettings addressSettings,
                               RewardPointsSettings rewardPointsSettings,
                               PdfSettings pdfSettings)
        {
            this._orderService           = orderService;
            this._shipmentService        = shipmentService;
            this._workContext            = workContext;
            this._currencyService        = currencyService;
            this._priceFormatter         = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._dateTimeHelper         = dateTimeHelper;
            this._paymentService         = paymentService;
            this._localizationService    = localizationService;
            this._pdfService             = pdfService;
            this._shippingService        = shippingService;
            this._countryService         = countryService;
            this._productAttributeParser = productAttributeParser;
            this._webHelper                    = webHelper;
            this._downloadService              = downloadService;
            this._addressAttributeFormatter    = addressAttributeFormatter;
            this._storeContext                 = storeContext;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._rewardPointService           = rewardPointService;

            this._catalogSettings      = catalogSettings;
            this._orderSettings        = orderSettings;
            this._taxSettings          = taxSettings;
            this._shippingSettings     = shippingSettings;
            this._addressSettings      = addressSettings;
            this._rewardPointsSettings = rewardPointsSettings;
            this._pdfSettings          = pdfSettings;
        }
        public CheckoutModelFactory(IAddressModelFactory addressModelFactory,
                                    IWorkContext workContext,
                                    IStoreContext storeContext,
                                    IStoreMappingService storeMappingService,
                                    ILocalizationService localizationService,
                                    ITaxService taxService,
                                    ICurrencyService currencyService,
                                    IPriceFormatter priceFormatter,
                                    IOrderProcessingService orderProcessingService,
                                    IProductAttributeParser productAttributeParser,
                                    IProductService productService,
                                    IGenericAttributeService genericAttributeService,
                                    ICountryService countryService,
                                    IStateProvinceService stateProvinceService,
                                    IShippingService shippingService,
                                    IPaymentService paymentService,
                                    IOrderTotalCalculationService orderTotalCalculationService,
                                    IRewardPointService rewardPointService,
                                    IWebHelper webHelper,
                                    CommonSettings commonSettings,
                                    OrderSettings orderSettings,
                                    RewardPointsSettings rewardPointsSettings,
                                    PaymentSettings paymentSettings,
                                    ShippingSettings shippingSettings,
                                    AddressSettings addressSettings)
        {
            this._addressModelFactory          = addressModelFactory;
            this._workContext                  = workContext;
            this._storeContext                 = storeContext;
            this._storeMappingService          = storeMappingService;
            this._localizationService          = localizationService;
            this._taxService                   = taxService;
            this._currencyService              = currencyService;
            this._priceFormatter               = priceFormatter;
            this._orderProcessingService       = orderProcessingService;
            this._productAttributeParser       = productAttributeParser;
            this._productService               = productService;
            this._genericAttributeService      = genericAttributeService;
            this._countryService               = countryService;
            this._stateProvinceService         = stateProvinceService;
            this._shippingService              = shippingService;
            this._paymentService               = paymentService;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._rewardPointService           = rewardPointService;
            this._webHelper = webHelper;

            this._commonSettings       = commonSettings;
            this._orderSettings        = orderSettings;
            this._rewardPointsSettings = rewardPointsSettings;
            this._paymentSettings      = paymentSettings;
            this._shippingSettings     = shippingSettings;
            this._addressSettings      = addressSettings;
        }
Пример #17
0
        public OrderModelFactory(IAddressModelFactory addressModelFactory,
                                 IOrderService orderService,
                                 IWorkContext workContext,
                                 ICurrencyService currencyService,
                                 IPriceFormatter priceFormatter,
                                 IOrderProcessingService orderProcessingService,
                                 IDateTimeHelper dateTimeHelper,
                                 IPaymentService paymentService,
                                 ILocalizationService localizationService,
                                 ILocalizedEntityService localizedEntityService,
                                 IShippingService shippingService,
                                 ICountryService countryService,
                                 IProductAttributeParser productAttributeParser,
                                 IDownloadService downloadService,
                                 IStoreContext storeContext,
                                 IOrderTotalCalculationService orderTotalCalculationService,
                                 IRewardPointService rewardPointService,
                                 ILanguageService languageService,
                                 ISettingService settingService
                                 )
        {
            this._addressModelFactory          = addressModelFactory;
            this._orderService                 = orderService;
            this._workContext                  = workContext;
            this._currencyService              = currencyService;
            this._priceFormatter               = priceFormatter;
            this._orderProcessingService       = orderProcessingService;
            this._dateTimeHelper               = dateTimeHelper;
            this._paymentService               = paymentService;
            this._localizationService          = localizationService;
            this._localizedEntityService       = localizedEntityService;
            this._shippingService              = shippingService;
            this._countryService               = countryService;
            this._productAttributeParser       = productAttributeParser;
            this._downloadService              = downloadService;
            this._storeContext                 = storeContext;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._rewardPointService           = rewardPointService;
            this._languageService              = languageService;
            this._settingService               = settingService;

            this._catalogSettings      = _settingService.LoadSetting <CatalogSettings>();
            this._orderSettings        = _settingService.LoadSetting <OrderSettings>();
            this._taxSettings          = _settingService.LoadSetting <TaxSettings>();
            this._shippingSettings     = _settingService.LoadSetting <ShippingSettings>();
            this._addressSettings      = _settingService.LoadSetting <AddressSettings>();
            this._rewardPointsSettings = _settingService.LoadSetting <RewardPointsSettings>();
            this._pdfSettings          = _settingService.LoadSetting <PdfSettings>();
        }
Пример #18
0
 public VendorRegistrationService(CustomerSettings customerSettings,
                                  ICustomerService customerService,
                                  IEncryptionService encryptionService,
                                  IEventPublisher eventPublisher,
                                  ILocalizationService localizationService,
                                  IRewardPointService rewardPointService,
                                  RewardPointsSettings rewardPointsSettings)
 {
     _customerSettings     = customerSettings;
     _customerService      = customerService;
     _encryptionService    = encryptionService;
     _eventPublisher       = eventPublisher;
     _localizationService  = localizationService;
     _rewardPointService   = rewardPointService;
     _rewardPointsSettings = rewardPointsSettings;
 }
Пример #19
0
        public async Task SetUp()
        {
            _settingService       = GetService <ISettingService>();
            _shippingSettings     = GetService <ShippingSettings>();
            _rewardPointsSettings = GetService <RewardPointsSettings>();
            _commonSettings       = GetService <CommonSettings>();

            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
            await _settingService.SaveSettingAsync(_shippingSettings);

            _paymentSettings = GetService <PaymentSettings>();
            _paymentSettings.ActivePaymentMethodSystemNames.Add("Payments.TestMethod");
            await _settingService.SaveSettingAsync(_paymentSettings);

            _customer = await GetService <IWorkContext>().GetCurrentCustomerAsync();

            _rewardPointService = GetService <IRewardPointService>();
            await _rewardPointService.AddRewardPointsHistoryEntryAsync(_customer, 10000, 1);

            _shoppingCartService = GetService <IShoppingCartService>();
            _productService      = GetService <IProductService>();
            _addressService      = GetService <IAddressService>();

            _address = new Address();

            await _addressService.InsertAddressAsync(_address);

            await GetService <ICustomerService>().InsertCustomerAddressAsync(_customer, _address);

            _orderSettings = GetService <OrderSettings>();

            await _shoppingCartService.AddToCartAsync(_customer, await _productService.GetProductByIdAsync(1), ShoppingCartType.ShoppingCart, 1);

            await _shoppingCartService.AddToCartAsync(_customer, await _productService.GetProductByIdAsync(2), ShoppingCartType.ShoppingCart, 1);

            await _shoppingCartService.AddToCartAsync(_customer, await _productService.GetProductByIdAsync(3), ShoppingCartType.ShoppingCart, 1);

            _cart = await _shoppingCartService.GetShoppingCartAsync(_customer, ShoppingCartType.ShoppingCart);

            _paymentMethod = (await GetService <IPaymentPluginManager>().LoadActivePluginsAsync(new List <string> {
                "Payments.TestMethod"
            })).FirstOrDefault();
            _orderService  = GetService <IOrderService>();

            _checkoutModelFactory = GetService <ICheckoutModelFactory>();
        }
 public FakeOrderTotalCalculationService(CatalogSettings catalogSettings = null,
                                         IAddressService addressService  = null,
                                         ICheckoutAttributeParser checkoutAttributeParser = null,
                                         ICustomerService customerService = null,
                                         IDiscountService discountService = null,
                                         IGenericAttributeService genericAttributeService = null,
                                         IGiftCardService giftCardService = null,
                                         IOrderService orderService       = null,
                                         IPaymentService paymentService   = null,
                                         IPriceCalculationService priceCalculationService = null,
                                         IProductService productService               = null,
                                         IRewardPointService rewardPointService       = null,
                                         IShippingPluginManager shippingPluginManager = null,
                                         IShippingService shippingService             = null,
                                         IShoppingCartService shoppingCartService     = null,
                                         IStoreContext storeContext = null,
                                         ITaxService taxService     = null,
                                         IWorkContext workContext   = null,
                                         RewardPointsSettings rewardPointsSettings = null,
                                         ShippingSettings shippingSettings         = null,
                                         ShoppingCartSettings shoppingCartSettings = null,
                                         TaxSettings taxSettings = null) : base(
         catalogSettings ?? new CatalogSettings(),
         addressService ?? new Mock <IAddressService>().Object,
         checkoutAttributeParser ?? new Mock <ICheckoutAttributeParser>().Object,
         customerService ?? new Mock <ICustomerService>().Object,
         discountService ?? new Mock <IDiscountService>().Object,
         genericAttributeService ?? new Mock <IGenericAttributeService>().Object,
         giftCardService ?? new Mock <IGiftCardService>().Object,
         orderService ?? new Mock <IOrderService>().Object,
         paymentService ?? new Mock <IPaymentService>().Object,
         priceCalculationService ?? new Mock <IPriceCalculationService>().Object,
         productService ?? new Mock <IProductService>().Object,
         rewardPointService ?? new Mock <IRewardPointService>().Object,
         shippingPluginManager ?? new Mock <IShippingPluginManager>().Object,
         shippingService ?? new Mock <IShippingService>().Object,
         shoppingCartService ?? new Mock <IShoppingCartService>().Object,
         storeContext ?? new Mock <IStoreContext>().Object,
         taxService ?? new Mock <ITaxService>().Object,
         workContext ?? new Mock <IWorkContext>().Object,
         rewardPointsSettings ?? new RewardPointsSettings(),
         shippingSettings ?? new ShippingSettings(),
         shoppingCartSettings ?? new ShoppingCartSettings(),
         taxSettings ?? new TaxSettings())
 {
 }
Пример #21
0
        public SubscriptionModelFactory(IAddressModelFactory addressModelFactory,
                                        ISubscriptionService subscriptionService,
                                        IWorkContext workContext,
                                        ICurrencyService currencyService,
                                        IPriceFormatter priceFormatter,
                                        ISubscriptionProcessingService subscriptionProcessingService,
                                        IDateTimeHelper dateTimeHelper,
                                        IPaymentService paymentService,
                                        ILocalizationService localizationService,
                                        ICountryService countryService,
                                        IArticleAttributeParser articleAttributeParser,
                                        IDownloadService downloadService,
                                        IStoreContext storeContext,
                                        ISubscriptionTotalCalculationService subscriptionTotalCalculationService,
                                        IRewardPointService rewardPointService,
                                        CatalogSettings catalogSettings,
                                        SubscriptionSettings subscriptionSettings,
                                        TaxSettings taxSettings,
                                        AddressSettings addressSettings,
                                        RewardPointsSettings rewardPointsSettings,
                                        PdfSettings pdfSettings)
        {
            this._addressModelFactory                 = addressModelFactory;
            this._subscriptionService                 = subscriptionService;
            this._workContext                         = workContext;
            this._currencyService                     = currencyService;
            this._priceFormatter                      = priceFormatter;
            this._subscriptionProcessingService       = subscriptionProcessingService;
            this._dateTimeHelper                      = dateTimeHelper;
            this._paymentService                      = paymentService;
            this._localizationService                 = localizationService;
            this._countryService                      = countryService;
            this._articleAttributeParser              = articleAttributeParser;
            this._downloadService                     = downloadService;
            this._storeContext                        = storeContext;
            this._subscriptionTotalCalculationService = subscriptionTotalCalculationService;
            this._rewardPointService                  = rewardPointService;

            this._catalogSettings      = catalogSettings;
            this._subscriptionSettings = subscriptionSettings;
            this._taxSettings          = taxSettings;
            this._addressSettings      = addressSettings;
            this._rewardPointsSettings = rewardPointsSettings;
            this._pdfSettings          = pdfSettings;
        }
 public ExtendedRewardPointsProgramTask(ICustomerService customerService,
                                        IGenericAttributeService genericAttributeService,
                                        IRewardPointsOnDateSettingsService rewardPointsOnDateSettingsService,
                                        IRewardPointService rewardPointService,
                                        IStoreService storeService,
                                        ILocalizationService localizationService,
                                        Core.Domain.Customers.RewardPointsSettings rewardPointsSettings,
                                        IStoreContext storeContext)
 {
     this._customerService                   = customerService;
     this._genericAttributeService           = genericAttributeService;
     this._rewardPointsOnDateSettingsService = rewardPointsOnDateSettingsService;
     this._rewardPointService                = rewardPointService;
     this._storeService         = storeService;
     this._localizationService  = localizationService;
     this._rewardPointsSettings = rewardPointsSettings;
     this._storeContext         = storeContext;
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="customerService">Customer service</param>
 /// <param name="encryptionService">Encryption service</param>
 /// <param name="newsLetterSubscriptionService">Newsletter subscription service</param>
 /// <param name="localizationService">Localization service</param>
 /// <param name="storeService">Store service</param>
 /// <param name="rewardPointService">Reward points service</param>
 /// <param name="rewardPointsSettings">Reward points settings</param>
 /// <param name="customerSettings">Customer settings</param>
 public CustomerRegistrationService(ICustomerService customerService, 
     IEncryptionService encryptionService, 
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     ILocalizationService localizationService,
     IStoreService storeService,
     IRewardPointService rewardPointService,
     RewardPointsSettings rewardPointsSettings,
     CustomerSettings customerSettings)
 {
     this._customerService = customerService;
     this._encryptionService = encryptionService;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._localizationService = localizationService;
     this._storeService = storeService;
     this._rewardPointService = rewardPointService;
     this._rewardPointsSettings = rewardPointsSettings;
     this._customerSettings = customerSettings;
 }
 public OverriddenOrderTotalCalculationService(CatalogSettings catalogSettings,
                                               ICheckoutAttributeParser checkoutAttributeParser,
                                               IDiscountService discountService,
                                               IGenericAttributeService genericAttributeService,
                                               IGiftCardService giftCardService,
                                               IHttpContextAccessor httpContextAccessor,
                                               IPaymentService paymentService,
                                               IPriceCalculationService priceCalculationService,
                                               IRewardPointService rewardPointService,
                                               IShippingService shippingService,
                                               IShoppingCartService shoppingCartService,
                                               IStoreContext storeContext,
                                               ITaxService taxService,
                                               IWorkContext workContext,
                                               RewardPointsSettings rewardPointsSettings,
                                               ShippingSettings shippingSettings,
                                               ShoppingCartSettings shoppingCartSettings,
                                               TaxSettings taxSettings) : base(catalogSettings,
                                                                               checkoutAttributeParser,
                                                                               discountService,
                                                                               genericAttributeService,
                                                                               giftCardService,
                                                                               paymentService,
                                                                               priceCalculationService,
                                                                               rewardPointService,
                                                                               shippingService,
                                                                               shoppingCartService,
                                                                               storeContext,
                                                                               taxService,
                                                                               workContext,
                                                                               rewardPointsSettings,
                                                                               shippingSettings,
                                                                               shoppingCartSettings,
                                                                               taxSettings)
 {
     this._genericAttributeService = genericAttributeService;
     this._httpContextAccessor     = httpContextAccessor;
     this._paymentService          = paymentService;
     this._priceCalculationService = priceCalculationService;
     this._storeContext            = storeContext;
     this._taxService           = taxService;
     this._shoppingCartSettings = shoppingCartSettings;
 }
 public CustomerRegistrationService(CustomerSettings customerSettings,
                                    IActionContextAccessor actionContextAccessor,
                                    IAuthenticationService authenticationService,
                                    ICustomerActivityService customerActivityService,
                                    ICustomerService customerService,
                                    IEncryptionService encryptionService,
                                    IEventPublisher eventPublisher,
                                    IGenericAttributeService genericAttributeService,
                                    ILocalizationService localizationService,
                                    IMultiFactorAuthenticationPluginManager multiFactorAuthenticationPluginManager,
                                    INewsLetterSubscriptionService newsLetterSubscriptionService,
                                    INotificationService notificationService,
                                    IRewardPointService rewardPointService,
                                    IShoppingCartService shoppingCartService,
                                    IStoreContext storeContext,
                                    IStoreService storeService,
                                    IUrlHelperFactory urlHelperFactory,
                                    IWorkContext workContext,
                                    IWorkflowMessageService workflowMessageService,
                                    RewardPointsSettings rewardPointsSettings)
 {
     _customerSettings        = customerSettings;
     _actionContextAccessor   = actionContextAccessor;
     _authenticationService   = authenticationService;
     _customerActivityService = customerActivityService;
     _customerService         = customerService;
     _encryptionService       = encryptionService;
     _eventPublisher          = eventPublisher;
     _genericAttributeService = genericAttributeService;
     _localizationService     = localizationService;
     _multiFactorAuthenticationPluginManager = multiFactorAuthenticationPluginManager;
     _newsLetterSubscriptionService          = newsLetterSubscriptionService;
     _notificationService    = notificationService;
     _rewardPointService     = rewardPointService;
     _shoppingCartService    = shoppingCartService;
     _storeContext           = storeContext;
     _storeService           = storeService;
     _urlHelperFactory       = urlHelperFactory;
     _workContext            = workContext;
     _workflowMessageService = workflowMessageService;
     _rewardPointsSettings   = rewardPointsSettings;
 }
Пример #26
0
 public CustomerController(ICustomerService customerService,
                           ICacheManager cacheManager,
                           LoginManager loginManager,
                           CustomerManager customerManager,
                           ISettingService settingService,
                           IOssService ossService,
                           ICustomerAttributeService attribteService,
                           IRewardPointService rewardPointService,
                           IEncryptionService encryptionService)
 {
     this._customerService    = customerService;
     this._customerManager    = customerManager;
     this._loginManager       = loginManager;
     this._cacheManager       = cacheManager;
     this._settingService     = settingService;
     this._attribteService    = attribteService;
     this._rewardPointService = rewardPointService;
     this._encryptionService  = encryptionService;
     this._ossService         = ossService;
 }
Пример #27
0
        private readonly ISMSNotificationService _smsNotificationService; //BUGFIX 3.802

        #endregion

        #region Ctor

        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="customerService">Customer service</param>
        /// <param name="encryptionService">Encryption service</param>
        /// <param name="newsLetterSubscriptionService">Newsletter subscription service</param>
        /// <param name="localizationService">Localization service</param>
        /// <param name="storeService">Store service</param>
        /// <param name="rewardPointService">Reward points service</param>
        /// <param name="rewardPointsSettings">Reward points settings</param>
        /// <param name="customerSettings">Customer settings</param>
        public CustomerRegistrationService(ICustomerService customerService,
                                           IEncryptionService encryptionService,
                                           INewsLetterSubscriptionService newsLetterSubscriptionService,
                                           ILocalizationService localizationService,
                                           IStoreService storeService,
                                           IRewardPointService rewardPointService,
                                           RewardPointsSettings rewardPointsSettings,
                                           CustomerSettings customerSettings,
                                           ISMSNotificationService smsNotificationService) //BUGFIX 3.802
        {
            this._customerService               = customerService;
            this._encryptionService             = encryptionService;
            this._newsLetterSubscriptionService = newsLetterSubscriptionService;
            this._localizationService           = localizationService;
            this._storeService           = storeService;
            this._rewardPointService     = rewardPointService;
            this._rewardPointsSettings   = rewardPointsSettings;
            this._customerSettings       = customerSettings;
            this._smsNotificationService = smsNotificationService; //BUGFIX 3.802
        }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="customerService">Customer service</param>
 /// <param name="encryptionService">Encryption service</param>
 /// <param name="newsLetterSubscriptionService">Newsletter subscription service</param>
 /// <param name="localizationService">Localization service</param>
 /// <param name="storeService">Store service</param>
 /// <param name="rewardPointService">Reward points service</param>
 /// <param name="rewardPointsSettings">Reward points settings</param>
 /// <param name="customerSettings">Customer settings</param>
 public GBSCustomerRegistrationService(
     IStoreContext storeContext,
     IPluginFinder pluginFinder,
     GBSLoginSettings gbsLoginSettings,
     ICustomerService customerService,
     IEncryptionService encryptionService,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     ILocalizationService localizationService,
     IStoreService storeService,
     IRewardPointService rewardPointService,
     IWorkContext workContext,
     IGenericAttributeService genericAttributeService,
     IWorkflowMessageService workflowMessageService,
     IEventPublisher eventPublisher,
     RewardPointsSettings rewardPointsSettings,
     CustomerSettings customerSettings,
     ILogger logger)
     : base(
         customerService,
         encryptionService,
         newsLetterSubscriptionService,
         localizationService,
         storeService,
         rewardPointService,
         workContext,
         genericAttributeService,
         workflowMessageService,
         eventPublisher,
         rewardPointsSettings,
         customerSettings
         )
 {
     this._gbsLoginSettings  = gbsLoginSettings;
     this._pluginFinder      = pluginFinder;
     this._storeContext      = storeContext;
     this._customerSettings  = customerSettings;
     this._encryptionService = encryptionService;
     this._logger            = logger;
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="customerService">Customer service</param>
 /// <param name="encryptionService">Encryption service</param>
 /// <param name="newsLetterSubscriptionService">Newsletter subscription service</param>
 /// <param name="localizationService">Localization service</param>
 /// <param name="storeService">Store service</param>
 /// <param name="rewardPointService">Reward points service</param>
 /// <param name="genericAttributeService">Generic attribute service</param>
 /// <param name="workContext">Work context</param>
 /// <param name="workflowMessageService">Workflow message service</param>
 /// <param name="rewardPointsSettings">Reward points settings</param>
 /// <param name="customerSettings">Customer settings</param>
 public CustomerRegistrationService(ICustomerService customerService,
                                    IEncryptionService encryptionService,
                                    INewsLetterSubscriptionService newsLetterSubscriptionService,
                                    ILocalizationService localizationService,
                                    IStoreService storeService,
                                    IRewardPointService rewardPointService,
                                    IWorkContext workContext,
                                    IGenericAttributeService genericAttributeService,
                                    IWorkflowMessageService workflowMessageService,
                                    RewardPointsSettings rewardPointsSettings,
                                    CustomerSettings customerSettings)
 {
     this._customerService               = customerService;
     this._encryptionService             = encryptionService;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._localizationService           = localizationService;
     this._storeService            = storeService;
     this._rewardPointService      = rewardPointService;
     this._genericAttributeService = genericAttributeService;
     this._workContext             = workContext;
     this._workflowMessageService  = workflowMessageService;
     this._rewardPointsSettings    = rewardPointsSettings;
     this._customerSettings        = customerSettings;
 }
Пример #30
0
        public CheckoutController(IWorkContext workContext,
            IStoreContext storeContext,
            IStoreMappingService storeMappingService,
            IShoppingCartService shoppingCartService,
            ILocalizationService localizationService,
            ITaxService taxService,
            ICurrencyService currencyService,
            IPriceFormatter priceFormatter,
            IOrderProcessingService orderProcessingService,
            ICustomerService customerService,
            IGenericAttributeService genericAttributeService,
            ICountryService countryService,
            IStateProvinceService stateProvinceService,
            IShippingService shippingService,
            IPaymentService paymentService,
            IPluginFinder pluginFinder,
            IOrderTotalCalculationService orderTotalCalculationService,
            IRewardPointService rewardPointService,
            ILogger logger,
            IOrderService orderService,
            IWebHelper webHelper,
            HttpContextBase httpContext,
            IAddressAttributeParser addressAttributeParser,
            IAddressAttributeService addressAttributeService,
            IAddressAttributeFormatter addressAttributeFormatter,
            OrderSettings orderSettings,
            RewardPointsSettings rewardPointsSettings,
            PaymentSettings paymentSettings,
            ShippingSettings shippingSettings,
            AddressSettings addressSettings,
            CustomerSettings customerSettings)
        {
            this._workContext = workContext;
            this._storeContext = storeContext;
            this._storeMappingService = storeMappingService;
            this._shoppingCartService = shoppingCartService;
            this._localizationService = localizationService;
            this._taxService = taxService;
            this._currencyService = currencyService;
            this._priceFormatter = priceFormatter;
            this._orderProcessingService = orderProcessingService;
            this._customerService = customerService;
            this._genericAttributeService = genericAttributeService;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._shippingService = shippingService;
            this._paymentService = paymentService;
            this._pluginFinder = pluginFinder;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._rewardPointService = rewardPointService;
            this._logger = logger;
            this._orderService = orderService;
            this._webHelper = webHelper;
            this._httpContext = httpContext;
            this._addressAttributeParser = addressAttributeParser;
            this._addressAttributeService = addressAttributeService;
            this._addressAttributeFormatter = addressAttributeFormatter;

            this._orderSettings = orderSettings;
            this._rewardPointsSettings = rewardPointsSettings;
            this._paymentSettings = paymentSettings;
            this._shippingSettings = shippingSettings;
            this._addressSettings = addressSettings;
            this._customerSettings = customerSettings;
        }
        public new void SetUp()
        {
            _workContext = null;

            _store = new Store {
                Id = 1
            };
            _storeContext = MockRepository.GenerateMock <IStoreContext>();
            _storeContext.Expect(x => x.CurrentStore).Return(_store);

            var pluginFinder = new PluginFinder();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings      = new CatalogSettings();

            var cacheManager = new NopNullCache();

            _productService = MockRepository.GenerateMock <IProductService>();

            //price calculation service
            _discountService     = MockRepository.GenerateMock <IDiscountService>();
            _categoryService     = MockRepository.GenerateMock <ICategoryService>();
            _manufacturerService = MockRepository.GenerateMock <IManufacturerService>();

            _productAttributeParser = MockRepository.GenerateMock <IProductAttributeParser>();
            _priceCalcService       = new PriceCalculationService(_workContext, _storeContext,
                                                                  _discountService, _categoryService, _manufacturerService,
                                                                  _productAttributeParser, _productService,
                                                                  cacheManager, _shoppingCartSettings, _catalogSettings);

            _eventPublisher = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            _localizationService = MockRepository.GenerateMock <ILocalizationService>();

            //shipping
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List <string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
            _shippingMethodRepository = MockRepository.GenerateMock <IRepository <ShippingMethod> >();
            _deliveryDateRepository   = MockRepository.GenerateMock <IRepository <DeliveryDate> >();
            _warehouseRepository      = MockRepository.GenerateMock <IRepository <Warehouse> >();
            _logger          = new NullLogger();
            _shippingService = new ShippingService(_shippingMethodRepository,
                                                   _deliveryDateRepository,
                                                   _warehouseRepository,
                                                   _logger,
                                                   _productService,
                                                   _productAttributeParser,
                                                   _checkoutAttributeParser,
                                                   _genericAttributeService,
                                                   _localizationService,
                                                   _addressService,
                                                   _shippingSettings,
                                                   pluginFinder,
                                                   _storeContext,
                                                   _eventPublisher,
                                                   _shoppingCartSettings,
                                                   cacheManager);
            _shipmentService = MockRepository.GenerateMock <IShipmentService>();


            _paymentService          = MockRepository.GenerateMock <IPaymentService>();
            _checkoutAttributeParser = MockRepository.GenerateMock <ICheckoutAttributeParser>();
            _giftCardService         = MockRepository.GenerateMock <IGiftCardService>();
            _genericAttributeService = MockRepository.GenerateMock <IGenericAttributeService>();

            _geoLookupService = MockRepository.GenerateMock <IGeoLookupService>();
            _countryService   = MockRepository.GenerateMock <ICountryService>();
            _customerSettings = new CustomerSettings();
            _addressSettings  = new AddressSettings();

            //tax
            _taxSettings = new TaxSettings();
            _taxSettings.ShippingIsTaxable = true;
            _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
            _taxSettings.DefaultTaxAddressId = 10;
            _addressService = MockRepository.GenerateMock <IAddressService>();
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address {
                Id = _taxSettings.DefaultTaxAddressId
            });
            _taxService = new TaxService(_addressService, _workContext, _taxSettings,
                                         pluginFinder, _geoLookupService, _countryService, _customerSettings, _addressSettings);

            _rewardPointService   = MockRepository.GenerateMock <IRewardPointService>();
            _rewardPointsSettings = new RewardPointsSettings();

            _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext,
                                                                      _priceCalcService, _taxService, _shippingService, _paymentService,
                                                                      _checkoutAttributeParser, _discountService, _giftCardService,
                                                                      _genericAttributeService, _rewardPointService,
                                                                      _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings);

            _orderService               = MockRepository.GenerateMock <IOrderService>();
            _webHelper                  = MockRepository.GenerateMock <IWebHelper>();
            _languageService            = MockRepository.GenerateMock <ILanguageService>();
            _priceFormatter             = MockRepository.GenerateMock <IPriceFormatter>();
            _productAttributeFormatter  = MockRepository.GenerateMock <IProductAttributeFormatter>();
            _shoppingCartService        = MockRepository.GenerateMock <IShoppingCartService>();
            _checkoutAttributeFormatter = MockRepository.GenerateMock <ICheckoutAttributeFormatter>();
            _customerService            = MockRepository.GenerateMock <ICustomerService>();
            _encryptionService          = MockRepository.GenerateMock <IEncryptionService>();
            _workflowMessageService     = MockRepository.GenerateMock <IWorkflowMessageService>();
            _customerActivityService    = MockRepository.GenerateMock <ICustomerActivityService>();
            _currencyService            = MockRepository.GenerateMock <ICurrencyService>();
            _affiliateService           = MockRepository.GenerateMock <IAffiliateService>();
            _vendorService              = MockRepository.GenerateMock <IVendorService>();
            _pdfService                 = MockRepository.GenerateMock <IPdfService>();

            _paymentSettings = new PaymentSettings
            {
                ActivePaymentMethodSystemNames = new List <string>
                {
                    "Payments.TestMethod"
                }
            };
            _orderSettings = new OrderSettings();

            _localizationSettings = new LocalizationSettings();

            _eventPublisher = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            _rewardPointService = MockRepository.GenerateMock <IRewardPointService>();
            _currencySettings   = new CurrencySettings();

            _orderProcessingService = new OrderProcessingService(_orderService, _webHelper,
                                                                 _localizationService, _languageService,
                                                                 _productService, _paymentService, _logger,
                                                                 _orderTotalCalcService, _priceCalcService, _priceFormatter,
                                                                 _productAttributeParser, _productAttributeFormatter,
                                                                 _giftCardService, _shoppingCartService, _checkoutAttributeFormatter,
                                                                 _shippingService, _shipmentService, _taxService,
                                                                 _customerService, _discountService,
                                                                 _encryptionService, _workContext,
                                                                 _workflowMessageService, _vendorService,
                                                                 _customerActivityService, _currencyService, _affiliateService,
                                                                 _eventPublisher, _pdfService, _rewardPointService,
                                                                 _shippingSettings, _paymentSettings, _rewardPointsSettings,
                                                                 _orderSettings, _taxSettings, _localizationSettings,
                                                                 _currencySettings);
        }
Пример #32
0
 public CustomerController(ICustomerService customerService,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     IGenericAttributeService genericAttributeService,
     ICustomerRegistrationService customerRegistrationService,
     ICustomerReportService customerReportService, 
     IDateTimeHelper dateTimeHelper,
     ILocalizationService localizationService, 
     DateTimeSettings dateTimeSettings,
     TaxSettings taxSettings, 
     RewardPointsSettings rewardPointsSettings,
     ICountryService countryService, 
     IStateProvinceService stateProvinceService, 
     IAddressService addressService,
     CustomerSettings customerSettings,
     ITaxService taxService, 
     IWorkContext workContext,
     IVendorService vendorService,
     IStoreContext storeContext,
     IPriceFormatter priceFormatter,
     IOrderService orderService, 
     IExportManager exportManager,
     ICustomerActivityService customerActivityService,
     IBackInStockSubscriptionService backInStockSubscriptionService,
     IPriceCalculationService priceCalculationService,
     IProductAttributeFormatter productAttributeFormatter,
     IPermissionService permissionService, 
     IQueuedEmailService queuedEmailService,
     EmailAccountSettings emailAccountSettings,
     IEmailAccountService emailAccountService, 
     ForumSettings forumSettings,
     IForumService forumService, 
     IOpenAuthenticationService openAuthenticationService,
     AddressSettings addressSettings,
     IStoreService storeService,
     ICustomerAttributeParser customerAttributeParser,
     ICustomerAttributeService customerAttributeService,
     IAddressAttributeParser addressAttributeParser,
     IAddressAttributeService addressAttributeService,
     IAddressAttributeFormatter addressAttributeFormatter,
     IAffiliateService affiliateService,
     IWorkflowMessageService workflowMessageService,
     IRewardPointService rewardPointService)
 {
     this._customerService = customerService;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._genericAttributeService = genericAttributeService;
     this._customerRegistrationService = customerRegistrationService;
     this._customerReportService = customerReportService;
     this._dateTimeHelper = dateTimeHelper;
     this._localizationService = localizationService;
     this._dateTimeSettings = dateTimeSettings;
     this._taxSettings = taxSettings;
     this._rewardPointsSettings = rewardPointsSettings;
     this._countryService = countryService;
     this._stateProvinceService = stateProvinceService;
     this._addressService = addressService;
     this._customerSettings = customerSettings;
     this._taxService = taxService;
     this._workContext = workContext;
     this._vendorService = vendorService;
     this._storeContext = storeContext;
     this._priceFormatter = priceFormatter;
     this._orderService = orderService;
     this._exportManager = exportManager;
     this._customerActivityService = customerActivityService;
     this._backInStockSubscriptionService = backInStockSubscriptionService;
     this._priceCalculationService = priceCalculationService;
     this._productAttributeFormatter = productAttributeFormatter;
     this._permissionService = permissionService;
     this._queuedEmailService = queuedEmailService;
     this._emailAccountSettings = emailAccountSettings;
     this._emailAccountService = emailAccountService;
     this._forumSettings = forumSettings;
     this._forumService = forumService;
     this._openAuthenticationService = openAuthenticationService;
     this._addressSettings = addressSettings;
     this._storeService = storeService;
     this._customerAttributeParser = customerAttributeParser;
     this._customerAttributeService = customerAttributeService;
     this._addressAttributeParser = addressAttributeParser;
     this._addressAttributeService = addressAttributeService;
     this._addressAttributeFormatter = addressAttributeFormatter;
     this._affiliateService = affiliateService;
     this._workflowMessageService = workflowMessageService;
     this._rewardPointService = rewardPointService;
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="orderService">Order service</param>
 /// <param name="webHelper">Web helper</param>
 /// <param name="localizationService">Localization service</param>
 /// <param name="languageService">Language service</param>
 /// <param name="productService">Product service</param>
 /// <param name="paymentService">Payment service</param>
 /// <param name="logger">Logger</param>
 /// <param name="orderTotalCalculationService">Order total calculationservice</param>
 /// <param name="priceCalculationService">Price calculation service</param>
 /// <param name="priceFormatter">Price formatter</param>
 /// <param name="productAttributeParser">Product attribute parser</param>
 /// <param name="productAttributeFormatter">Product attribute formatter</param>
 /// <param name="giftCardService">Gift card service</param>
 /// <param name="shoppingCartService">Shopping cart service</param>
 /// <param name="checkoutAttributeFormatter">Checkout attribute service</param>
 /// <param name="shippingService">Shipping service</param>
 /// <param name="shipmentService">Shipment service</param>
 /// <param name="taxService">Tax service</param>
 /// <param name="customerService">Customer service</param>
 /// <param name="discountService">Discount service</param>
 /// <param name="encryptionService">Encryption service</param>
 /// <param name="workContext">Work context</param>
 /// <param name="workflowMessageService">Workflow message service</param>
 /// <param name="vendorService">Vendor service</param>
 /// <param name="customerActivityService">Customer activity service</param>
 /// <param name="currencyService">Currency service</param>
 /// <param name="affiliateService">Affiliate service</param>
 /// <param name="eventPublisher">Event published</param>
 /// <param name="pdfService">PDF service</param>
 /// <param name="paymentSettings">Payment settings</param>
 /// <param name="shippingSettings">Shipping settings</param>
 /// <param name="rewardPointsSettings">Reward points settings</param>
 /// <param name="orderSettings">Order settings</param>
 /// <param name="taxSettings">Tax settings</param>
 /// <param name="localizationSettings">Localization settings</param>
 /// <param name="currencySettings">Currency settings</param>
 public OrderProcessingService(IOrderService orderService,
     IWebHelper webHelper,
     ILocalizationService localizationService,
     ILanguageService languageService,
     IProductService productService,
     IPaymentService paymentService,
     ILogger logger,
     IOrderTotalCalculationService orderTotalCalculationService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IProductAttributeParser productAttributeParser,
     IProductAttributeFormatter productAttributeFormatter,
     IGiftCardService giftCardService,
     IShoppingCartService shoppingCartService,
     ICheckoutAttributeFormatter checkoutAttributeFormatter,
     IShippingService shippingService,
     IShipmentService shipmentService,
     ITaxService taxService,
     ICustomerService customerService,
     IDiscountService discountService,
     IEncryptionService encryptionService,
     IWorkContext workContext,
     IWorkflowMessageService workflowMessageService,
     IVendorService vendorService,
     ICustomerActivityService customerActivityService,
     ICurrencyService currencyService,
     IAffiliateService affiliateService,
     IEventPublisher eventPublisher,
     IPdfService pdfService,
     IRewardPointService rewardPointService,
     ShippingSettings shippingSettings,
     PaymentSettings paymentSettings,
     RewardPointsSettings rewardPointsSettings,
     OrderSettings orderSettings,
     TaxSettings taxSettings,
     LocalizationSettings localizationSettings,
     CurrencySettings currencySettings,
     IGenericAttributeService genericAttributeService,
     PromoSettings promoSettings,
     IPromoUtilities promoUtilities,
     IPromoOrderService promoOrderService,
     IPromoService promoService,
     IStoreContext storeContext)
     : base(orderService, webHelper, localizationService, languageService, productService, paymentService,
                                                 logger, orderTotalCalculationService, priceCalculationService, priceFormatter, productAttributeParser,
                                                 productAttributeFormatter, giftCardService, shoppingCartService, checkoutAttributeFormatter, shippingService,
                                                 shipmentService, taxService, customerService, discountService, encryptionService, workContext, workflowMessageService,
                                                 vendorService, customerActivityService, currencyService, affiliateService, eventPublisher, pdfService, rewardPointService,
                                                 genericAttributeService, shippingSettings, paymentSettings, rewardPointsSettings, orderSettings, taxSettings,
                                                 localizationSettings, currencySettings)
 {
     this._orderService = orderService;
     this._webHelper = webHelper;
     this._localizationService = localizationService;
     this._languageService = languageService;
     this._productService = productService;
     this._paymentService = paymentService;
     this._logger = logger;
     this._orderTotalCalculationService = orderTotalCalculationService;
     this._priceCalculationService = priceCalculationService;
     this._priceFormatter = priceFormatter;
     this._productAttributeParser = productAttributeParser;
     this._productAttributeFormatter = productAttributeFormatter;
     this._giftCardService = giftCardService;
     this._shoppingCartService = shoppingCartService;
     this._checkoutAttributeFormatter = checkoutAttributeFormatter;
     this._workContext = workContext;
     this._workflowMessageService = workflowMessageService;
     this._vendorService = vendorService;
     this._shippingService = shippingService;
     this._shipmentService = shipmentService;
     this._taxService = taxService;
     this._customerService = customerService;
     this._discountService = discountService;
     this._encryptionService = encryptionService;
     this._customerActivityService = customerActivityService;
     this._currencyService = currencyService;
     this._affiliateService = affiliateService;
     this._eventPublisher = eventPublisher;
     this._pdfService = pdfService;
     this._rewardPointService = rewardPointService;
     this._paymentSettings = paymentSettings;
     this._shippingSettings = shippingSettings;
     this._rewardPointsSettings = rewardPointsSettings;
     this._orderSettings = orderSettings;
     this._taxSettings = taxSettings;
     this._localizationSettings = localizationSettings;
     this._currencySettings = currencySettings;
     this._genericAttributeService = genericAttributeService;
     this._promoSettings = promoSettings;
     this._promoUtilities = promoUtilities;
     this._promoOrderService = promoOrderService;
     this._promoService = promoService;
     this._storeContext = storeContext;
 }
        public new void SetUp()
        {
            _customerSettings = new CustomerSettings
            {
                UnduplicatedPasswordsNumber = 1,
                HashedPasswordFormat        = "SHA512"
            };
            _securitySettings = new SecuritySettings
            {
                EncryptionKey = "273ece6f97dd844d"
            };
            _rewardPointsSettings = new RewardPointsSettings
            {
                Enabled = false,
            };

            _encryptionService = new EncryptionService(_securitySettings);
            _customerRepo      = MockRepository.GenerateMock <IRepository <Customer> >();
            var customer1 = new Customer
            {
                Id       = 1,
                Username = "******",
                Email    = "*****@*****.**",
                Active   = true
            };

            AddCustomerToRegisteredRole(customer1);

            var customer2 = new Customer
            {
                Id       = 2,
                Username = "******",
                Email    = "*****@*****.**",
                Active   = true
            };

            AddCustomerToRegisteredRole(customer2);

            var customer3 = new Customer
            {
                Id       = 3,
                Username = "******",
                Email    = "*****@*****.**",
                Active   = true
            };

            AddCustomerToRegisteredRole(customer3);

            var customer4 = new Customer
            {
                Id       = 4,
                Username = "******",
                Email    = "*****@*****.**",
                Active   = true
            };

            AddCustomerToRegisteredRole(customer4);

            var customer5 = new Customer
            {
                Id       = 5,
                Username = "******",
                Email    = "*****@*****.**",
                Active   = true
            };

            _customerRepo.Expect(x => x.Table).Return(new List <Customer> {
                customer1, customer2, customer3, customer4, customer5
            }.AsQueryable());

            _customerPasswordRepo = MockRepository.GenerateMock <IRepository <CustomerPassword> >();
            var saltKey   = _encryptionService.CreateSaltKey(5);
            var password  = _encryptionService.CreatePasswordHash("password", saltKey, "SHA512");
            var password1 = new CustomerPassword
            {
                CustomerId     = customer1.Id,
                PasswordFormat = PasswordFormat.Hashed,
                PasswordSalt   = saltKey,
                Password       = password,
                CreatedOnUtc   = DateTime.UtcNow
            };
            var password2 = new CustomerPassword
            {
                CustomerId     = customer2.Id,
                PasswordFormat = PasswordFormat.Clear,
                Password       = "******",
                CreatedOnUtc   = DateTime.UtcNow
            };
            var password3 = new CustomerPassword
            {
                CustomerId     = customer3.Id,
                PasswordFormat = PasswordFormat.Encrypted,
                Password       = _encryptionService.EncryptText("password"),
                CreatedOnUtc   = DateTime.UtcNow
            };
            var password4 = new CustomerPassword
            {
                CustomerId     = customer4.Id,
                PasswordFormat = PasswordFormat.Clear,
                Password       = "******",
                CreatedOnUtc   = DateTime.UtcNow
            };
            var password5 = new CustomerPassword
            {
                CustomerId     = customer5.Id,
                PasswordFormat = PasswordFormat.Clear,
                Password       = "******",
                CreatedOnUtc   = DateTime.UtcNow
            };

            _customerPasswordRepo.Expect(x => x.Table).Return(new[] { password1, password2, password3, password4, password5 }.AsQueryable());

            _eventPublisher = MockRepository.GenerateMock <IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg <object> .Is.Anything));

            _storeService         = MockRepository.GenerateMock <IStoreService>();
            _customerRoleRepo     = MockRepository.GenerateMock <IRepository <CustomerRole> >();
            _genericAttributeRepo = MockRepository.GenerateMock <IRepository <GenericAttribute> >();
            _orderRepo            = MockRepository.GenerateMock <IRepository <Order> >();
            _forumPostRepo        = MockRepository.GenerateMock <IRepository <ForumPost> >();
            _forumTopicRepo       = MockRepository.GenerateMock <IRepository <ForumTopic> >();

            _genericAttributeService       = MockRepository.GenerateMock <IGenericAttributeService>();
            _newsLetterSubscriptionService = MockRepository.GenerateMock <INewsLetterSubscriptionService>();
            _rewardPointService            = MockRepository.GenerateMock <IRewardPointService>();

            _localizationService    = MockRepository.GenerateMock <ILocalizationService>();
            _workContext            = MockRepository.GenerateMock <IWorkContext>();
            _workflowMessageService = MockRepository.GenerateMock <IWorkflowMessageService>();

            _customerService = new CustomerService(new NopNullCache(), _customerRepo, _customerPasswordRepo, _customerRoleRepo,
                                                   _genericAttributeRepo, _orderRepo, _forumPostRepo, _forumTopicRepo,
                                                   null, null, null, null, null,
                                                   _genericAttributeService, null, null, _eventPublisher, _customerSettings, null);
            _customerRegistrationService = new CustomerRegistrationService(_customerService,
                                                                           _encryptionService, _newsLetterSubscriptionService, _localizationService,
                                                                           _storeService, _rewardPointService, _workContext, _genericAttributeService,
                                                                           _workflowMessageService, _eventPublisher, _rewardPointsSettings, _customerSettings);
        }
        public new void SetUp()
        {
            _customerSettings = new CustomerSettings();
            _securitySettings = new SecuritySettings
            {
                EncryptionKey = "273ece6f97dd844d"
            };
            _rewardPointsSettings = new RewardPointsSettings
            {
                Enabled = false,
            };

            _encryptionService = new EncryptionService(_securitySettings);
            _customerRepo = MockRepository.GenerateMock<IRepository<Customer>>();
            var customer1 = new Customer
            {
                Username = "******",
                Email = "*****@*****.**",
                PasswordFormat = PasswordFormat.Hashed,
                Active = true
            };

            string saltKey = _encryptionService.CreateSaltKey(5);
            string password = _encryptionService.CreatePasswordHash("password", saltKey);
            customer1.PasswordSalt = saltKey;
            customer1.Password = password;
            AddCustomerToRegisteredRole(customer1);

            var customer2 = new Customer
            {
                Username = "******",
                Email = "*****@*****.**",
                PasswordFormat = PasswordFormat.Clear,
                Password = "******",
                Active = true
            };
            AddCustomerToRegisteredRole(customer2);

            var customer3 = new Customer
            {
                Username = "******",
                Email = "*****@*****.**",
                PasswordFormat = PasswordFormat.Encrypted,
                Password = _encryptionService.EncryptText("password"),
                Active = true
            };
            AddCustomerToRegisteredRole(customer3);

            var customer4 = new Customer
            {
                Username = "******",
                Email = "*****@*****.**",
                PasswordFormat = PasswordFormat.Clear,
                Password = "******",
                Active = true
            };
            AddCustomerToRegisteredRole(customer4);

            var customer5 = new Customer
            {
                Username = "******",
                Email = "*****@*****.**",
                PasswordFormat = PasswordFormat.Clear,
                Password = "******",
                Active = true
            };

            _eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));

            _storeService = MockRepository.GenerateMock<IStoreService>();

            _customerRepo.Expect(x => x.Table).Return(new List<Customer> { customer1, customer2, customer3, customer4, customer5 }.AsQueryable());

            _customerRoleRepo = MockRepository.GenerateMock<IRepository<CustomerRole>>();
            _genericAttributeRepo = MockRepository.GenerateMock<IRepository<GenericAttribute>>();
            _orderRepo = MockRepository.GenerateMock<IRepository<Order>>();
            _forumPostRepo = MockRepository.GenerateMock<IRepository<ForumPost>>();
            _forumTopicRepo = MockRepository.GenerateMock<IRepository<ForumTopic>>();

            _genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();
            _newsLetterSubscriptionService = MockRepository.GenerateMock<INewsLetterSubscriptionService>();
            _rewardPointService = MockRepository.GenerateMock<IRewardPointService>();

            _localizationService = MockRepository.GenerateMock<ILocalizationService>();
            _customerService = new CustomerService(new NopNullCache(), _customerRepo, _customerRoleRepo,
                _genericAttributeRepo, _orderRepo, _forumPostRepo, _forumTopicRepo,
                null, null, null, null, null,
                _genericAttributeService, null, null, _eventPublisher, _customerSettings, null);
            _customerRegistrationService = new CustomerRegistrationService(_customerService,
                _encryptionService, _newsLetterSubscriptionService, _localizationService,
                _storeService, _rewardPointService, _rewardPointsSettings, _customerSettings);
        }
 public MmsOrderProcessingOverride(
     CurrencySettings currencySettings,
     IAddressService addressService,
     IAffiliateService affiliateService,
     ICheckoutAttributeFormatter checkoutAttributeFormatter,
     ICountryService countryService,
     ICurrencyService currencyService,
     ICustomerActivityService customerActivityService,
     ICustomerService customerService,
     ICustomNumberFormatter customNumberFormatter,
     IDiscountService discountService,
     IEncryptionService encryptionService,
     IEventPublisher eventPublisher,
     IGenericAttributeService genericAttributeService,
     IGiftCardService giftCardService,
     ILanguageService languageService,
     ILocalizationService localizationService,
     ILogger logger,
     IOrderService orderService,
     IOrderTotalCalculationService orderTotalCalculationService,
     IPaymentPluginManager paymentPluginManager,
     IPaymentService paymentService,
     IPdfService pdfService,
     IPriceCalculationService priceCalculationService,
     IPriceFormatter priceFormatter,
     IProductAttributeFormatter productAttributeFormatter,
     IProductAttributeParser productAttributeParser,
     IProductService productService,
     IRewardPointService rewardPointService,
     IShipmentService shipmentService,
     IShippingService shippingService,
     IShoppingCartService shoppingCartService,
     IStateProvinceService stateProvinceService,
     ITaxService taxService,
     IVendorService vendorService,
     IWebHelper webHelper,
     IWorkContext workContext,
     IWorkflowMessageService workflowMessageService,
     LocalizationSettings localizationSettings,
     OrderSettings orderSettings,
     PaymentSettings paymentSettings,
     RewardPointsSettings rewardPointsSettings,
     ShippingSettings shippingSettings,
     TaxSettings taxSettings,
     MmsAdminService mmsadminService) : base(
         currencySettings,
         addressService,
         affiliateService,
         checkoutAttributeFormatter,
         countryService,
         currencyService,
         customerActivityService,
         customerService,
         customNumberFormatter,
         discountService,
         encryptionService,
         eventPublisher,
         genericAttributeService,
         giftCardService,
         languageService,
         localizationService,
         logger,
         orderService,
         orderTotalCalculationService,
         paymentPluginManager,
         paymentService,
         pdfService,
         priceCalculationService,
         priceFormatter,
         productAttributeFormatter,
         productAttributeParser,
         productService,
         rewardPointService,
         shipmentService,
         shippingService,
         shoppingCartService,
         stateProvinceService,
         taxService,
         vendorService,
         webHelper,
         workContext,
         workflowMessageService,
         localizationSettings,
         orderSettings,
         paymentSettings,
         rewardPointsSettings,
         shippingSettings,
         taxSettings)
 {
     _currencySettings           = currencySettings;
     _addressService             = addressService;
     _affiliateService           = affiliateService;
     _checkoutAttributeFormatter = checkoutAttributeFormatter;
     _countryService             = countryService;
     _currencyService            = currencyService;
     _customerActivityService    = customerActivityService;
     _customerService            = customerService;
     _customNumberFormatter      = customNumberFormatter;
     _discountService            = discountService;
     _encryptionService          = encryptionService;
     _eventPublisher             = eventPublisher;
     _genericAttributeService    = genericAttributeService;
     _giftCardService            = giftCardService;
     _languageService            = languageService;
     _localizationService        = localizationService;
     _logger       = logger;
     _orderService = orderService;
     _orderTotalCalculationService = orderTotalCalculationService;
     _paymentPluginManager         = paymentPluginManager;
     _paymentService            = paymentService;
     _pdfService                = pdfService;
     _priceCalculationService   = priceCalculationService;
     _priceFormatter            = priceFormatter;
     _productAttributeFormatter = productAttributeFormatter;
     _productAttributeParser    = productAttributeParser;
     _productService            = productService;
     _rewardPointService        = rewardPointService;
     _shipmentService           = shipmentService;
     _shippingService           = shippingService;
     _shoppingCartService       = shoppingCartService;
     _stateProvinceService      = stateProvinceService;
     _taxService                = taxService;
     _vendorService             = vendorService;
     _webHelper              = webHelper;
     _workContext            = workContext;
     _workflowMessageService = workflowMessageService;
     _localizationSettings   = localizationSettings;
     _orderSettings          = orderSettings;
     _paymentSettings        = paymentSettings;
     _rewardPointsSettings   = rewardPointsSettings;
     _shippingSettings       = shippingSettings;
     _taxSettings            = taxSettings;
     _mmsadminService        = mmsadminService;
 }
        public new void SetUp()
        {
            _workContext = MockRepository.GenerateMock<IWorkContext>();

            _store = new Store { Id = 1 };
            _storeContext = MockRepository.GenerateMock<IStoreContext>();
            _storeContext.Expect(x => x.CurrentStore).Return(_store);

            _productService = MockRepository.GenerateMock<IProductService>();

            var pluginFinder = new PluginFinder();
            var cacheManager = new NopNullCache();

            _discountService = MockRepository.GenerateMock<IDiscountService>();
            _categoryService = MockRepository.GenerateMock<ICategoryService>();
            _manufacturerService = MockRepository.GenerateMock<IManufacturerService>();
            _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>();

            _shoppingCartSettings = new ShoppingCartSettings();
            _catalogSettings = new CatalogSettings();

            _priceCalcService = new PriceCalculationService(_workContext, _storeContext,
                _discountService, _categoryService,
                _manufacturerService, _productAttributeParser,
                _productService, cacheManager,
                _shoppingCartSettings, _catalogSettings);

            _eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));

            _localizationService = MockRepository.GenerateMock<ILocalizationService>();

            //shipping
            _shippingSettings = new ShippingSettings();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>();
            _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod");
            _shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>();
            _deliveryDateRepository = MockRepository.GenerateMock<IRepository<DeliveryDate>>();
            _warehouseRepository = MockRepository.GenerateMock<IRepository<Warehouse>>();
            _logger = new NullLogger();
            _shippingService = new ShippingService(_shippingMethodRepository,
                _deliveryDateRepository,
                _warehouseRepository,
                _logger,
                _productService,
                _productAttributeParser,
                _checkoutAttributeParser,
                _genericAttributeService,
                _localizationService,
                _addressService,
                _shippingSettings,
                pluginFinder,
                _storeContext,
                _eventPublisher,
                _shoppingCartSettings,
                cacheManager);

            _paymentService = MockRepository.GenerateMock<IPaymentService>();
            _checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>();
            _giftCardService = MockRepository.GenerateMock<IGiftCardService>();
            _genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>();

            _eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
            _eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));

            _geoLookupService = MockRepository.GenerateMock<IGeoLookupService>();
            _countryService = MockRepository.GenerateMock<ICountryService>();
            _customerSettings = new CustomerSettings();
            _addressSettings = new AddressSettings();

            //tax
            _taxSettings = new TaxSettings();
            _taxSettings.ShippingIsTaxable = true;
            _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true;
            _taxSettings.DefaultTaxAddressId = 10;
            _addressService = MockRepository.GenerateMock<IAddressService>();
            _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId });
            _taxService = new TaxService(_addressService, _workContext, _taxSettings,
                pluginFinder, _geoLookupService, _countryService, _logger, _customerSettings, _addressSettings);
            _rewardPointService = MockRepository.GenerateMock<IRewardPointService>();

            _rewardPointsSettings = new RewardPointsSettings();

            _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext,
                _priceCalcService, _taxService, _shippingService, _paymentService,
                _checkoutAttributeParser, _discountService, _giftCardService, _genericAttributeService,
                _rewardPointService, _taxSettings, _rewardPointsSettings,
                _shippingSettings, _shoppingCartSettings, _catalogSettings);
        }
Пример #38
0
        public GBSOrderModelFactory(IAddressModelFactory addressModelFactory,
                                    IOrderService orderService,
                                    IWorkContext workContext,
                                    ICurrencyService currencyService,
                                    IPriceFormatter priceFormatter,
                                    IOrderProcessingService orderProcessingService,
                                    IDateTimeHelper dateTimeHelper,
                                    IPaymentService paymentService,
                                    ILocalizationService localizationService,
                                    IShippingService shippingService,
                                    ICountryService countryService,
                                    IProductAttributeParser productAttributeParser,
                                    IDownloadService downloadService,
                                    IStoreContext storeContext,
                                    IOrderTotalCalculationService orderTotalCalculationService,
                                    IRewardPointService rewardPointService,
                                    CatalogSettings catalogSettings,
                                    OrderSettings orderSettings,
                                    TaxSettings taxSettings,
                                    ShippingSettings shippingSettings,
                                    AddressSettings addressSettings,
                                    RewardPointsSettings rewardPointsSettings,
                                    PdfSettings pdfSettings,
                                    IPluginFinder pluginFinder,
                                    GBSOrderSettings gbsOrderSettings,
                                    ILogger logger) : base(
                addressModelFactory,
                orderService,
                workContext,
                currencyService,
                priceFormatter,
                orderProcessingService,
                dateTimeHelper,
                paymentService,
                localizationService,
                shippingService,
                countryService,
                productAttributeParser,
                downloadService,
                storeContext,
                orderTotalCalculationService,
                rewardPointService,
                catalogSettings,
                orderSettings,
                taxSettings,
                shippingSettings,
                addressSettings,
                rewardPointsSettings,
                pdfSettings
                )
        {
            this._addressModelFactory          = addressModelFactory;
            this._orderService                 = orderService;
            this._workContext                  = workContext;
            this._currencyService              = currencyService;
            this._priceFormatter               = priceFormatter;
            this._orderProcessingService       = orderProcessingService;
            this._dateTimeHelper               = dateTimeHelper;
            this._paymentService               = paymentService;
            this._localizationService          = localizationService;
            this._shippingService              = shippingService;
            this._countryService               = countryService;
            this._productAttributeParser       = productAttributeParser;
            this._downloadService              = downloadService;
            this._storeContext                 = storeContext;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._rewardPointService           = rewardPointService;

            this._catalogSettings      = catalogSettings;
            this._orderSettings        = orderSettings;
            this._taxSettings          = taxSettings;
            this._shippingSettings     = shippingSettings;
            this._addressSettings      = addressSettings;
            this._rewardPointsSettings = rewardPointsSettings;
            this._pdfSettings          = pdfSettings;

            this._pluginFinder     = pluginFinder;
            this._gbsOrderSettings = gbsOrderSettings;
            this._logger           = logger;
        }