public PluginController(IPluginFinder pluginFinder, ILocalizationService localizationService, IWebHelper webHelper, IPermissionService permissionService, ILanguageService languageService, ISettingService settingService, IStoreService storeService, PaymentSettings paymentSettings, ShippingSettings shippingSettings, TaxSettings taxSettings, ExternalAuthenticationSettings externalAuthenticationSettings, WidgetSettings widgetSettings) { this._pluginFinder = pluginFinder; this._localizationService = localizationService; this._webHelper = webHelper; this._permissionService = permissionService; this._languageService = languageService; this._settingService = settingService; this._storeService = storeService; this._paymentSettings = paymentSettings; this._shippingSettings = shippingSettings; this._taxSettings = taxSettings; this._externalAuthenticationSettings = externalAuthenticationSettings; this._widgetSettings = widgetSettings; }
/// <summary> /// Ctor /// </summary> /// <param name="cacheManager">Cache manager</param> /// <param name="shippingMethodRepository">Shipping method repository</param> /// <param name="logger">Logger</param> /// <param name="productAttributeParser">Product attribute parser</param> /// <param name="productService">Product service</param> /// <param name="checkoutAttributeParser">Checkout attribute parser</param> /// <param name="genericAttributeService">Generic attribute service</param> /// <param name="localizationService">Localization service</param> /// <param name="shippingSettings">Shipping settings</param> /// <param name="pluginFinder">Plugin finder</param> /// <param name="eventPublisher">Event published</param> /// <param name="shoppingCartSettings">Shopping cart settings</param> /// <param name="settingService">Setting service</param> public ShippingService(ICacheManager cacheManager, IRepository<ShippingMethod> shippingMethodRepository, ILogger logger, IProductAttributeParser productAttributeParser, IProductService productService, ICheckoutAttributeParser checkoutAttributeParser, IGenericAttributeService genericAttributeService, ILocalizationService localizationService, ShippingSettings shippingSettings, IPluginFinder pluginFinder, IEventPublisher eventPublisher, ShoppingCartSettings shoppingCartSettings, ISettingService settingService, IProviderManager providerManager) { this._cacheManager = cacheManager; this._shippingMethodRepository = shippingMethodRepository; this._logger = logger; this._productAttributeParser = productAttributeParser; this._productService = productService; this._checkoutAttributeParser = checkoutAttributeParser; this._genericAttributeService = genericAttributeService; this._localizationService = localizationService; this._shippingSettings = shippingSettings; this._pluginFinder = pluginFinder; this._eventPublisher = eventPublisher; this._shoppingCartSettings = shoppingCartSettings; this._settingService = settingService; this._providerManager = providerManager; }
/// <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="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, IProviderManager providerManager, ICheckoutAttributeParser checkoutAttributeParser, IDiscountService discountService, IGiftCardService giftCardService, IGenericAttributeService genericAttributeService, IProductAttributeParser productAttributeParser, 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._providerManager = providerManager; this._checkoutAttributeParser = checkoutAttributeParser; this._discountService = discountService; this._giftCardService = giftCardService; this._genericAttributeService = genericAttributeService; this._productAttributeParser = productAttributeParser; this._taxSettings = taxSettings; this._rewardPointsSettings = rewardPointsSettings; this._shippingSettings = shippingSettings; this._shoppingCartSettings = shoppingCartSettings; this._catalogSettings = catalogSettings; }
public PluginController(IPluginFinder pluginFinder, IPermissionService permissionService, ILanguageService languageService, PaymentSettings paymentSettings, ShippingSettings shippingSettings, TaxSettings taxSettings, ExternalAuthenticationSettings externalAuthenticationSettings, WidgetSettings widgetSettings, IProviderManager providerManager, PluginMediator pluginMediator, ICommonServices commonService) { this._pluginFinder = pluginFinder; this._permissionService = permissionService; this._languageService = languageService; this._paymentSettings = paymentSettings; this._shippingSettings = shippingSettings; this._taxSettings = taxSettings; this._externalAuthenticationSettings = externalAuthenticationSettings; this._widgetSettings = widgetSettings; this._providerManager = providerManager; this._pluginMediator = pluginMediator; this._commonService = commonService; T = NullLocalizer.Instance; }
public static bool IsShippingRateComputationMethodActive(this Provider<IShippingRateComputationMethod> srcm, ShippingSettings shippingSettings) { if (srcm == null) throw new ArgumentNullException("srcm"); if (shippingSettings == null) throw new ArgumentNullException("shippingSettings"); if (shippingSettings.ActiveShippingRateComputationMethodSystemNames == null) return false; return shippingSettings.ActiveShippingRateComputationMethodSystemNames.Contains(srcm.Metadata.SystemName, StringComparer.OrdinalIgnoreCase); }
public ShippingController(IShippingService shippingService, ShippingSettings shippingSettings, ILocalizedEntityService localizedEntityService, ILanguageService languageService, PluginMediator pluginMediator, ICommonServices services) { this._shippingService = shippingService; this._shippingSettings = shippingSettings; this._localizedEntityService = localizedEntityService; this._languageService = languageService; this._pluginMediator = pluginMediator; this._services = services; }
public static bool IsShippingRateComputationMethodActive(this IShippingRateComputationMethod srcm, ShippingSettings shippingSettings) { if (srcm == null) throw new ArgumentNullException("srcm"); if (shippingSettings == null) throw new ArgumentNullException("shippingSettings"); if (shippingSettings.ActiveShippingRateComputationMethodSystemNames == null) return false; foreach (string activeMethodSystemName in shippingSettings.ActiveShippingRateComputationMethodSystemNames) if (srcm.PluginDescriptor.SystemName.Equals(activeMethodSystemName, StringComparison.InvariantCultureIgnoreCase)) return true; return false; }
public ShippingController(IShippingService shippingService, ShippingSettings shippingSettings, ISettingService settingService, ICountryService countryService, ILocalizationService localizationService, IPermissionService permissionService, ILocalizedEntityService localizedEntityService, ILanguageService languageService, IPluginFinder pluginFinder) { this._shippingService = shippingService; this._shippingSettings = shippingSettings; this._settingService = settingService; this._countryService = countryService; this._localizationService = localizationService; this._permissionService = permissionService; this._localizedEntityService = localizedEntityService; this._languageService = languageService; this._pluginFinder = pluginFinder; }
private readonly ICheckoutAttributeFormatter _checkoutAttributeFormatter; //codehint: sm-add #endregion #region Constructors 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, IWebHelper webHelper, CatalogSettings catalogSettings, OrderSettings orderSettings, TaxSettings taxSettings, PdfSettings pdfSettings, ShippingSettings shippingSettings, AddressSettings addressSettings, ICheckoutAttributeFormatter checkoutAttributeFormatter, IProductService productService, IProductAttributeFormatter productAttributeFormatter) { 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._webHelper = webHelper; this._productService = productService; this._productAttributeFormatter = productAttributeFormatter; this._catalogSettings = catalogSettings; this._orderSettings = orderSettings; this._taxSettings = taxSettings; this._pdfSettings = pdfSettings; this._shippingSettings = shippingSettings; this._addressSettings = addressSettings; this._checkoutAttributeFormatter = checkoutAttributeFormatter; //codehint: sm-add }
public new void SetUp() { _shippingSettings = new ShippingSettings(); _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>(); _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod"); _shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>(); _logger = new NullLogger(); _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>(); _productService = MockRepository.GenerateMock<IProductService>(); _checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>(); var cacheManager = new NullCache(); var pluginFinder = new PluginFinder(); _eventPublisher = MockRepository.GenerateMock<IEventPublisher>(); _eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything)); _localizationService = MockRepository.GenerateMock<ILocalizationService>(); _genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>(); _settingService = MockRepository.GenerateMock<ISettingService>(); _shoppingCartSettings = new ShoppingCartSettings(); _shippingService = new ShippingService(cacheManager, _shippingMethodRepository, _logger, _productAttributeParser, _productService, _checkoutAttributeParser, _genericAttributeService, _localizationService, _shippingSettings, pluginFinder, _eventPublisher, _shoppingCartSettings, _settingService, this.ProviderManager); }
public ShoppingCartController(IProductService productService, IWorkContext workContext, IStoreContext storeContext, IShoppingCartService shoppingCartService, IPictureService pictureService, ILocalizationService localizationService, IProductAttributeService productAttributeService, IProductAttributeFormatter productAttributeFormatter, IProductAttributeParser productAttributeParser, ITaxService taxService, ICurrencyService currencyService, IPriceCalculationService priceCalculationService, IPriceFormatter priceFormatter, ICheckoutAttributeParser checkoutAttributeParser, ICheckoutAttributeFormatter checkoutAttributeFormatter, IOrderProcessingService orderProcessingService, IDiscountService discountService,ICustomerService customerService, IGiftCardService giftCardService, ICountryService countryService, IStateProvinceService stateProvinceService, IShippingService shippingService, IOrderTotalCalculationService orderTotalCalculationService, ICheckoutAttributeService checkoutAttributeService, IPaymentService paymentService, IWorkflowMessageService workflowMessageService, IPermissionService permissionService, IDeliveryTimeService deliveryTimeService, IDownloadService downloadService, ICacheManager cacheManager, IWebHelper webHelper, ICustomerActivityService customerActivityService, IGenericAttributeService genericAttributeService, MediaSettings mediaSettings, ShoppingCartSettings shoppingCartSettings, CatalogSettings catalogSettings, OrderSettings orderSettings, ShippingSettings shippingSettings, TaxSettings taxSettings, CaptchaSettings captchaSettings, AddressSettings addressSettings, HttpContextBase httpContext, PluginMediator pluginMediator, IQuantityUnitService quantityUnitService) { this._productService = productService; this._workContext = workContext; this._storeContext = storeContext; this._shoppingCartService = shoppingCartService; this._pictureService = pictureService; this._localizationService = localizationService; this._productAttributeService = productAttributeService; this._productAttributeFormatter = productAttributeFormatter; this._productAttributeParser = productAttributeParser; this._taxService = taxService; this._currencyService = currencyService; this._priceCalculationService = priceCalculationService; this._priceFormatter = priceFormatter; this._checkoutAttributeParser = checkoutAttributeParser; this._checkoutAttributeFormatter = checkoutAttributeFormatter; this._orderProcessingService = orderProcessingService; this._discountService = discountService; this._customerService = customerService; this._giftCardService = giftCardService; this._countryService = countryService; this._stateProvinceService = stateProvinceService; this._shippingService = shippingService; this._orderTotalCalculationService = orderTotalCalculationService; this._checkoutAttributeService = checkoutAttributeService; this._paymentService = paymentService; this._workflowMessageService = workflowMessageService; this._permissionService = permissionService; this._downloadService = downloadService; this._cacheManager = cacheManager; this._webHelper = webHelper; this._customerActivityService = customerActivityService; this._genericAttributeService = genericAttributeService; this._deliveryTimeService = deliveryTimeService; this._httpContext = httpContext; this._mediaSettings = mediaSettings; this._shoppingCartSettings = shoppingCartSettings; this._catalogSettings = catalogSettings; this._orderSettings = orderSettings; this._shippingSettings = shippingSettings; this._taxSettings = taxSettings; this._captchaSettings = captchaSettings; this._addressSettings = addressSettings; this._pluginMediator = pluginMediator; this._quantityUnitService = quantityUnitService; }
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(); var cacheManager = new NullCache(); _shoppingCartSettings = new ShoppingCartSettings(); _catalogSettings = new CatalogSettings(); //price calculation service _discountService = MockRepository.GenerateMock<IDiscountService>(); _categoryService = MockRepository.GenerateMock<ICategoryService>(); _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>(); _priceCalcService = new PriceCalculationService(_workContext, _storeContext, _discountService, _categoryService, _productAttributeParser, _productService, _shoppingCartSettings, _catalogSettings); _eventPublisher = MockRepository.GenerateMock<IEventPublisher>(); _eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything)); _localizationService = MockRepository.GenerateMock<ILocalizationService>(); _settingService = MockRepository.GenerateMock<ISettingService>(); //shipping _shippingSettings = new ShippingSettings(); _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>(); _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod"); _shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>(); _logger = new NullLogger(); _shippingService = new ShippingService(cacheManager, _shippingMethodRepository, _logger, _productAttributeParser, _productService, _checkoutAttributeParser, _genericAttributeService, _localizationService, _shippingSettings, pluginFinder, _eventPublisher, _shoppingCartSettings, _settingService); _shipmentService = MockRepository.GenerateMock<IShipmentService>(); _paymentService = MockRepository.GenerateMock<IPaymentService>(); _checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>(); _giftCardService = MockRepository.GenerateMock<IGiftCardService>(); _genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>(); //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, _shoppingCartSettings, pluginFinder, _settingService); _rewardPointsSettings = new RewardPointsSettings(); _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext, _priceCalcService, _taxService, _shippingService, _paymentService, _checkoutAttributeParser, _discountService, _giftCardService, _genericAttributeService, _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings); _orderService = MockRepository.GenerateMock<IOrderService>(); _webHelper = MockRepository.GenerateMock<IWebHelper>(); _languageService = MockRepository.GenerateMock<ILanguageService>(); _productService = MockRepository.GenerateMock<IProductService>(); _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>(); _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)); _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, _storeContext, _workflowMessageService, _customerActivityService, _currencyService, _affiliateService, _eventPublisher, _paymentSettings, _rewardPointsSettings, _orderSettings, _taxSettings, _localizationSettings, _currencySettings); }
public static ShippingSettings ToEntity(this ShippingSettingsModel model, ShippingSettings destination) { return Mapper.Map(model, destination); }
public new void SetUp() { _workContext = MockRepository.GenerateMock<IWorkContext>(); _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(); //price calculation service _discountService = MockRepository.GenerateMock<IDiscountService>(); _categoryService = MockRepository.GenerateMock<ICategoryService>(); _productAttributeParser = MockRepository.GenerateMock<IProductAttributeParser>(); _productService = MockRepository.GenerateMock<IProductService>(); _productAttributeService = MockRepository.GenerateMock<IProductAttributeService>(); _genericAttributeService = MockRepository.GenerateMock<IGenericAttributeService>(); _eventPublisher = MockRepository.GenerateMock<IEventPublisher>(); _eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything)); _settingService = MockRepository.GenerateMock<ISettingService>(); _typeFinder = MockRepository.GenerateMock<ITypeFinder>(); //shipping _shippingSettings = new ShippingSettings(); _shippingSettings.ActiveShippingRateComputationMethodSystemNames = new List<string>(); _shippingSettings.ActiveShippingRateComputationMethodSystemNames.Add("FixedRateTestShippingRateComputationMethod"); _shippingMethodRepository = MockRepository.GenerateMock<IRepository<ShippingMethod>>(); _logger = new NullLogger(); _shippingService = new ShippingService( _shippingMethodRepository, _logger, _productAttributeParser, _productService, _checkoutAttributeParser, _genericAttributeService, _shippingSettings, _eventPublisher, _shoppingCartSettings, _settingService, this.ProviderManager, _typeFinder); _providerManager = MockRepository.GenerateMock<IProviderManager>(); _checkoutAttributeParser = MockRepository.GenerateMock<ICheckoutAttributeParser>(); _giftCardService = MockRepository.GenerateMock<IGiftCardService>(); //tax _taxSettings = new TaxSettings(); _taxSettings.ShippingIsTaxable = true; _taxSettings.PaymentMethodAdditionalFeeIsTaxable = true; _taxSettings.PricesIncludeTax = false; _taxSettings.TaxDisplayType = TaxDisplayType.IncludingTax; _taxSettings.DefaultTaxAddressId = 10; _addressService = MockRepository.GenerateMock<IAddressService>(); _addressService.Expect(x => x.GetAddressById(_taxSettings.DefaultTaxAddressId)).Return(new Address { Id = _taxSettings.DefaultTaxAddressId }); _downloadService = MockRepository.GenerateMock<IDownloadService>(); _services = MockRepository.GenerateMock<ICommonServices>(); _httpRequestBase = MockRepository.GenerateMock<HttpRequestBase>(); _geoCountryLookup = MockRepository.GenerateMock<IGeoCountryLookup>(); _taxService = new TaxService(_addressService, _workContext, _taxSettings, _shoppingCartSettings, pluginFinder, _geoCountryLookup, this.ProviderManager); _rewardPointsSettings = new RewardPointsSettings(); _priceCalcService = new PriceCalculationService(_discountService, _categoryService, _productAttributeParser, _productService, _shoppingCartSettings, _catalogSettings, _productAttributeService, _downloadService, _services, _httpRequestBase, _taxService); _orderTotalCalcService = new OrderTotalCalculationService(_workContext, _storeContext, _priceCalcService, _taxService, _shippingService, _providerManager, _checkoutAttributeParser, _discountService, _giftCardService, _genericAttributeService, _productAttributeParser, _taxSettings, _rewardPointsSettings, _shippingSettings, _shoppingCartSettings, _catalogSettings); }