/// <summary> /// This is a helper contructor for unit testing /// </summary> internal CatalogShippingApiController(MerchelloContext merchelloContext, UmbracoContext umbracoContext) : base(merchelloContext, umbracoContext) { _gatewayProviderService = MerchelloContext.Services.GatewayProviderService; _storeSettingService = MerchelloContext.Services.StoreSettingService; _shipCountryService = ((ServiceContext)MerchelloContext.Services).ShipCountryService; }
public override void FixtureSetup() { base.FixtureSetup(); var defaultWarehouse = DbPreTestDataWorker.WarehouseService.GetDefaultWarehouse(); var defaultCatalog = defaultWarehouse.WarehouseCatalogs.FirstOrDefault(); if (defaultCatalog == null) Assert.Ignore("Default WarehouseCatalog is null"); DbPreTestDataWorker.DeleteAllShipCountries(); var uk = MerchelloContext.Current.Services.StoreSettingService.GetCountryByCode("GB"); var ukCountry = new ShipCountry(defaultCatalog.Key, uk); ((ServiceContext)MerchelloContext.Current.Services).ShipCountryService.Save(ukCountry); this._settingService = MerchelloContext.Current.Services.StoreSettingService; var setting = this._settingService.GetByKey(Core.Constants.StoreSettingKeys.GlobalTaxationApplicationKey); setting.Value = "Product"; this._settingService.Save(setting); var taxProvider = MerchelloContext.Current.Gateways.Taxation.GetProviderByKey(Constants.ProviderKeys.Taxation.FixedRateTaxationProviderKey); taxProvider.DeleteAllTaxMethods(); var gwTaxMethod = taxProvider.CreateTaxMethod("GB", 25); gwTaxMethod.TaxMethod.ProductTaxMethod = true; taxProvider.SaveTaxMethod(gwTaxMethod); ((TaxationContext)MerchelloContext.Current.Gateways.Taxation).ClearProductPricingMethod(); DbPreTestDataWorker.DeleteAllProducts(); var product = MockProductDataMaker.MockProductForInserting("Product", "PR", 16M); product.SalePrice = 12M; MerchelloContext.Current.Services.ProductService.Save(product); _productKey = product.Key; }
/// <summary> /// Initializes a new instance of the <see cref="CheckoutRenderControllerBase"/> class. /// </summary> /// <param name="merchelloContext"> /// The merchello context. /// </param> protected CheckoutRenderControllerBase(IMerchelloContext merchelloContext) { Mandate.ParameterNotNull(merchelloContext, "merchelloContext"); _storeSettingService = merchelloContext.Services.StoreSettingService; _gatewayContext = merchelloContext.Gateways; this.Initialize(); }
public void Init() { _gatewayProviderService = PreTestDataWorker.GatewayProviderService; _storeSettingService = PreTestDataWorker.StoreSettingService; _shipCountryService = PreTestDataWorker.ShipCountryService; _merchelloContext = new MerchelloContext(new ServiceContext(new PetaPocoUnitOfWorkProvider()), new CacheHelper(new NullCacheProvider(), new NullCacheProvider(), new NullCacheProvider())); _catalog = PreTestDataWorker.WarehouseService.GetDefaultWarehouse().WarehouseCatalogs.FirstOrDefault(); PreTestDataWorker.DeleteAllShipCountries(); var country = _storeSettingService.GetCountryByCode("US"); var shipCountry = new ShipCountry(_catalog.Key, country); _shipCountryService.Save(shipCountry); var shippingProvider = (FixedRateShippingGatewayProvider) _merchelloContext.Gateways.Shipping.CreateInstance(Core.Constants.ProviderKeys.Shipping.FixedRateShippingProviderKey); Assert.NotNull(shippingProvider); var resource = shippingProvider.ListResourcesOffered().FirstOrDefault(); var gatewayShipMethod = shippingProvider.CreateShippingGatewayMethod(resource, shipCountry, "Ground"); shippingProvider.SaveShippingGatewayMethod(gatewayShipMethod); }
public override void FixtureSetup() { base.FixtureSetup(); // assert we have our defaults setup var dtos = PreTestDataWorker.Database.Query<WarehouseDto>("SELECT * FROM merchWarehouse"); var catalogs = PreTestDataWorker.Database.Query<WarehouseCatalogDto>("SELECT * FROM merchWarehouseCatalog"); if (!dtos.Any() || !catalogs.Any()) { Assert.Ignore("Warehouse defaults are not installed."); } // TODO : This is only going to be the case for the initial Merchello release Catalog = PreTestDataWorker.WarehouseService.GetDefaultWarehouse().WarehouseCatalogs.FirstOrDefault(); if (Catalog == null) { Assert.Ignore("Warehouse Catalog is null"); } GatewayProviderService = PreTestDataWorker.GatewayProviderService; StoreSettingService = PreTestDataWorker.StoreSettingService; ShipCountryService = PreTestDataWorker.ShipCountryService; PreTestDataWorker.DeleteAllShipCountries(); const string countryCode = "US"; var us = StoreSettingService.GetCountryByCode(countryCode); var shipCountry = new ShipCountry(Catalog.Key, us); ShipCountryService.Save(shipCountry); var dk = StoreSettingService.GetCountryByCode("DK"); ShipCountryService.Save(new ShipCountry(Catalog.Key, dk)); }
/// <summary> /// Initializes a new instance of the <see cref="ShipmentResultNotifyModelFactory"/> class. /// </summary> /// <param name="merchelloContext"> /// The <see cref="IMerchelloContext"/>. /// </param> public ShipmentResultNotifyModelFactory(IMerchelloContext merchelloContext) { Mandate.ParameterNotNull(merchelloContext, "merchelloContext"); _invoiceService = merchelloContext.Services.InvoiceService; _orderService = merchelloContext.Services.OrderService; _storeSettingService = merchelloContext.Services.StoreSettingService; }
/// <summary> /// Constructor /// </summary> /// <param name="merchelloContext"></param> public ShippingGatewayApiController(MerchelloContext merchelloContext) : base(merchelloContext) { _shippingContext = MerchelloContext.Gateways.Shipping; _gatewayProviderService = MerchelloContext.Services.GatewayProviderService; _storeSettingService = MerchelloContext.Services.StoreSettingService; _shipCountryService = ((ServiceContext)MerchelloContext.Services).ShipCountryService; }
/// <summary> /// Initializes a new instance of the <see cref="ShipmentService"/> class. /// </summary> /// <param name="provider"> /// The provider. /// </param> /// <param name="repositoryFactory"> /// The repository factory. /// </param> /// <param name="storeSettingService"> /// The store Setting Service. /// </param> public ShipmentService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, IStoreSettingService storeSettingService) { Mandate.ParameterNotNull(provider, "provider"); Mandate.ParameterNotNull(repositoryFactory, "repositoryFactory"); Mandate.ParameterNotNull(storeSettingService, "storeSettingService"); _uowProvider = provider; _repositoryFactory = repositoryFactory; _storeSettingService = storeSettingService; }
/// <summary> /// Initializes a new instance of the <see cref="BazaarSiteApiController"/> class. /// </summary> /// <param name="merchelloContext"> /// The merchello context. /// </param> public BazaarSiteApiController(IMerchelloContext merchelloContext) { Mandate.ParameterNotNull(merchelloContext, "merchelloContext"); _merchelloContext = merchelloContext; _storeSettingService = _merchelloContext.Services.StoreSettingService; _merchello = new MerchelloHelper(_merchelloContext.Services); this.Initialize(); }
internal InvoiceService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, IAppliedPaymentService appliedPaymentService, IOrderService orderService, IStoreSettingService storeSettingService) { Mandate.ParameterNotNull(provider, "provider"); Mandate.ParameterNotNull(repositoryFactory, "repositoryFactory"); Mandate.ParameterNotNull(appliedPaymentService, "appliedPaymentService"); Mandate.ParameterNotNull(storeSettingService, "storeSettingService"); Mandate.ParameterNotNull(orderService, "orderService"); _uowProvider = provider; _repositoryFactory = repositoryFactory; _appliedPaymentService = appliedPaymentService; _orderService = orderService; _storeSettingService = storeSettingService; }
private void BuildGatewayContext(IGatewayProviderService gatewayProviderService, IStoreSettingService storeSettingService) { if(_notification == null) _notification = new Lazy<INotificationContext>(() => new NotificationContext(gatewayProviderService, _resolver)); if (_payment == null) _payment = new Lazy<IPaymentContext>(() => new PaymentContext(gatewayProviderService, _resolver)); if(_shipping == null) _shipping = new Lazy<IShippingContext>(() => new ShippingContext(gatewayProviderService, storeSettingService, _resolver)); if(_taxation == null) _taxation = new Lazy<ITaxationContext>(() => new TaxationContext(gatewayProviderService, _resolver)); }
/// <summary> /// Initializes a new instance of the <see cref="InvoiceService"/> class. /// </summary> /// <param name="provider"> /// The provider. /// </param> /// <param name="repositoryFactory"> /// The repository factory. /// </param> /// <param name="appliedPaymentService"> /// The applied payment service. /// </param> /// <param name="orderService"> /// The order service. /// </param> /// <param name="storeSettingService"> /// The store setting service. /// </param> internal InvoiceService( IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, IAppliedPaymentService appliedPaymentService, IOrderService orderService, IStoreSettingService storeSettingService) { Mandate.ParameterNotNull(provider, "provider"); Mandate.ParameterNotNull(repositoryFactory, "repositoryFactory"); Mandate.ParameterNotNull(appliedPaymentService, "appliedPaymentService"); Mandate.ParameterNotNull(storeSettingService, "storeSettingService"); Mandate.ParameterNotNull(orderService, "orderService"); _uowProvider = provider; _repositoryFactory = repositoryFactory; _appliedPaymentService = appliedPaymentService; _orderService = orderService; _storeSettingService = storeSettingService; }
public override void FixtureSetup() { base.FixtureSetup(); var defaultWarehouse = DbPreTestDataWorker.WarehouseService.GetDefaultWarehouse(); var defaultCatalog = defaultWarehouse.WarehouseCatalogs.FirstOrDefault(); if (defaultCatalog == null) { Assert.Ignore("Default WarehouseCatalog is null"); } DbPreTestDataWorker.DeleteAllShipCountries(); var uk = MerchelloContext.Current.Services.StoreSettingService.GetCountryByCode("GB"); var ukCountry = new ShipCountry(defaultCatalog.Key, uk); ((ServiceContext)MerchelloContext.Current.Services).ShipCountryService.Save(ukCountry); this._settingService = MerchelloContext.Current.Services.StoreSettingService; var setting = this._settingService.GetByKey(Core.Constants.StoreSetting.GlobalTaxationApplicationKey); setting.Value = "Product"; this._settingService.Save(setting); var taxProvider = MerchelloContext.Current.Gateways.Taxation.GetProviderByKey(Constants.ProviderKeys.Taxation.FixedRateTaxationProviderKey); taxProvider.DeleteAllTaxMethods(); var gwTaxMethod = taxProvider.CreateTaxMethod("GB", 25); gwTaxMethod.TaxMethod.ProductTaxMethod = true; taxProvider.SaveTaxMethod(gwTaxMethod); ((TaxationContext)MerchelloContext.Current.Gateways.Taxation).ClearProductPricingMethod(); DbPreTestDataWorker.DeleteAllProducts(); var product = MockProductDataMaker.MockProductForInserting("Product", "PR", 16M); product.SalePrice = 12M; MerchelloContext.Current.Services.ProductService.Save(product); _productKey = product.Key; }
public void FixtureInit() { // assert we have our defaults setup var dtos = PreTestDataWorker.Database.Query <WarehouseDto>("SELECT * FROM merchWarehouse"); var catalogs = PreTestDataWorker.Database.Query <WarehouseCatalogDto>("SELECT * FROM merchWarehouseCatalog"); if (!dtos.Any() || !catalogs.Any()) { Assert.Ignore("Warehouse defaults are not installed."); } // TODO : This is only going to be the case for the initial Merchello release _catalog = PreTestDataWorker.WarehouseService.GetDefaultWarehouse().WarehouseCatalogs.FirstOrDefault(); if (_catalog == null) { Assert.Ignore("Warehouse Catalog is null"); } _storeSettingService = PreTestDataWorker.StoreSettingService; _shipCountryService = PreTestDataWorker.ShipCountryService; }
public override void FixtureSetup() { base.FixtureSetup(); // assert we have our defaults setup var dtos = PreTestDataWorker.Database.Query <WarehouseDto>("SELECT * FROM merchWarehouse"); var catalogs = PreTestDataWorker.Database.Query <WarehouseCatalogDto>("SELECT * FROM merchWarehouseCatalog"); if (!dtos.Any() || !catalogs.Any()) { Assert.Ignore("Warehouse defaults are not installed."); } // TODO : This is only going to be the case for the initial Merchello release Catalog = PreTestDataWorker.WarehouseService.GetDefaultWarehouse().WarehouseCatalogs.FirstOrDefault(); if (Catalog == null) { Assert.Ignore("Warehouse Catalog is null"); } GatewayProviderService = PreTestDataWorker.GatewayProviderService; StoreSettingService = PreTestDataWorker.StoreSettingService; ShipCountryService = PreTestDataWorker.ShipCountryService; PreTestDataWorker.DeleteAllShipCountries(); const string countryCode = "US"; var us = StoreSettingService.GetCountryByCode(countryCode); var shipCountry = new ShipCountry(Catalog.Key, us); ShipCountryService.Save(shipCountry); var dk = StoreSettingService.GetCountryByCode("DK"); ShipCountryService.Save(new ShipCountry(Catalog.Key, dk)); }
/// <summary> /// Initializes a new instance of the <see cref="ShipmentService"/> class. /// </summary> /// <param name="provider"> /// The provider. /// </param> /// <param name="repositoryFactory"> /// The repository factory. /// </param> /// <param name="logger"> /// The logger. /// </param> /// <param name="storeSettingService"> /// The store Setting Service. /// </param> public ShipmentService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IStoreSettingService storeSettingService) : this(provider, repositoryFactory, logger, new TransientMessageFactory(), storeSettingService) { }
public ShipCountryFactory(IStoreSettingService storeSettingService) { _storeSettingService = storeSettingService; }
/// <summary> /// Initializes a new instance of the <see cref="ProductContentFactory"/> class. /// </summary> /// <param name="storeSettingService"> /// The <see cref="IStoreSettingService"/>. /// </param> internal ProductContentFactory(IStoreSettingService storeSettingService) { _storeSettingService = storeSettingService; this.Initialize(); }
/// <summary> /// Initializes a new instance of the <see cref="FastTrackBillingAddressModelFactory"/> class. /// </summary> /// <param name="storeSettingService"> /// The store setting service. /// </param> public FastTrackBillingAddressModelFactory(IStoreSettingService storeSettingService) { Mandate.ParameterNotNull(storeSettingService, "storeSettingService"); _storeSettingService = storeSettingService; }
/// <summary> /// Initializes a new instance of the <see cref="ProductContentFactory"/> class. /// </summary> /// <param name="storeSettingService"> /// The store setting service. /// </param> /// <param name="detachedContentTypeService"> /// The detached content type service. /// </param> internal ProductContentFactory(IStoreSettingService storeSettingService, IDetachedContentTypeService detachedContentTypeService) { _storeSettingService = storeSettingService; _detachedContentTypeService = detachedContentTypeService; this.Initialize(); }
public void Init() { _storeSettingService = new StoreSettingService(); }
/// <summary> /// Initializes a new instance of the <see cref="CurrencyContext"/> class. /// </summary> /// <param name="storeSettingService"> /// The store setting service. /// </param> internal CurrencyContext(IStoreSettingService storeSettingService) { Mandate.ParameterNotNull(storeSettingService, "storeSettingService"); this._storeSettingService = storeSettingService; }
/// <summary> /// The store setting service on saved. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private void StoreSettingServiceOnSaved(IStoreSettingService sender, SaveEventArgs<IStoreSetting> e) { var setting = e.SavedEntities.FirstOrDefault(x => x.Key == Core.Constants.StoreSettingKeys.GlobalTaxationApplicationKey); if (setting == null) return; var taxationContext = (TaxationContext)MerchelloContext.Current.Gateways.Taxation; taxationContext.ClearProductPricingMethod(); if (setting.Value == "Product") return; var taxMethodService = ((ServiceContext)MerchelloContext.Current.Services).TaxMethodService; var methods = taxMethodService.GetAll().ToArray(); foreach (var method in methods) { method.ProductTaxMethod = false; } taxMethodService.Save(methods); }
/// <summary> /// Initializes a new instance of the <see cref="ShipCountryRepository"/> class. /// </summary> /// <param name="work"> /// The work. /// </param> /// <param name="cache"> /// The cache. /// </param> /// <param name="storeSettingService"> /// The store setting service. /// </param> /// <param name="logger"> /// The logger. /// </param> /// <param name="sqlSyntax"> /// The SQL syntax. /// </param> public ShipCountryRepository(IDatabaseUnitOfWork work, IRuntimeCacheProvider cache, IStoreSettingService storeSettingService, ILogger logger, ISqlSyntaxProvider sqlSyntax) : base(work, cache, logger, sqlSyntax) { Mandate.ParameterNotNull(storeSettingService, "settingsService"); _storeSettingService = storeSettingService; }
/// <summary> /// Initializes a new instance of the <see cref="InvoiceService"/> class. /// </summary> /// <param name="repositoryFactory"> /// The repository factory. /// </param> /// <param name="appliedPaymentService"> /// The applied payment service. /// </param> /// <param name="orderService"> /// The order service. /// </param> /// <param name="storeSettingService"> /// The store setting service. /// </param> internal InvoiceService(RepositoryFactory repositoryFactory, IAppliedPaymentService appliedPaymentService, IOrderService orderService, IStoreSettingService storeSettingService) : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, appliedPaymentService, orderService, storeSettingService) { }
public void FixtureInit() { // assert we have our defaults setup var dtos = PreTestDataWorker.Database.Query<WarehouseDto>("SELECT * FROM merchWarehouse"); var catalogs = PreTestDataWorker.Database.Query<WarehouseCatalogDto>("SELECT * FROM merchWarehouseCatalog"); if (!dtos.Any() || !catalogs.Any()) { Assert.Ignore("Warehouse defaults are not installed."); } // TODO : This is only going to be the case for the initial Merchello release _catalog = PreTestDataWorker.WarehouseService.GetDefaultWarehouse().WarehouseCatalogs.FirstOrDefault(); if (_catalog == null) { Assert.Ignore("Warehouse Catalog is null"); } _storeSettingService = PreTestDataWorker.StoreSettingService; _shipCountryService = PreTestDataWorker.ShipCountryService; }
/// <summary> /// Initializes a new instance of the <see cref="OrderService"/> class. /// </summary> /// <param name="provider"> /// The provider. /// </param> /// <param name="repositoryFactory"> /// The repository factory. /// </param> /// <param name="logger"> /// The logger. /// </param> /// <param name="eventMessagesFactory"> /// The event messages factory. /// </param> /// <param name="storeSettingService"> /// The store setting service. /// </param> /// <param name="shipmentService"> /// The shipment service. /// </param> public OrderService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory, IStoreSettingService storeSettingService, IShipmentService shipmentService) : base(provider, repositoryFactory, logger, eventMessagesFactory) { Mandate.ParameterNotNull(storeSettingService, "storeSettingService"); Mandate.ParameterNotNull(shipmentService, "shipmentService"); _storeSettingService = storeSettingService; _shipmentService = shipmentService; }
/// <summary> /// Returns an instance of the <see cref="IShipCountryRepository"/> /// </summary> /// <param name="uow"> /// The database unit of work /// </param> /// <param name="storeSettingService"> /// The store Setting Service. /// </param> /// <returns> /// The <see cref="IShipCountryRepository"/>. /// </returns> internal virtual IShipCountryRepository CreateShipCountryRepository(IDatabaseUnitOfWork uow, IStoreSettingService storeSettingService) { return new ShipCountryRepository(uow, _disableAllCache ? _nullCacheProvider : _runtimeCacheProvider, storeSettingService); }
/// <summary> /// Initializes a new instance of the <see cref="ProductContentFactory"/> class. /// </summary> /// <param name="storeSettingService"> /// The <see cref="IStoreSettingService"/>. /// </param> internal ProductContentFactory(IStoreSettingService storeSettingService) : this(storeSettingService, MerchelloContext.Current.Services.DetachedContentTypeService) { }
/// <summary> /// Resets the store currency. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The save event args. /// </param> private void StoreSettingServiceSaved( IStoreSettingService sender, Umbraco.Core.Events.SaveEventArgs<Models.IStoreSetting> e) { CurrencyContext.Current.ResetCurrency(); }
/// <summary> /// Initializes the <see cref="CurrencyContext"/>. /// </summary> /// <param name="storeSettingService"> /// The store setting service. /// </param> protected virtual void InitialCurrencyContext(IStoreSettingService storeSettingService) { CurrencyContext.Current = new CurrencyContext(storeSettingService); }
public OrderService(RepositoryFactory repositoryFactory, IStoreSettingService storeSettingService, IShipmentService shipmentService) : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, storeSettingService, shipmentService) { }
public void Init() { _settingsService = PreTestDataWorker.StoreSettingService; }
internal InvoiceService(RepositoryFactory repositoryFactory, IAppliedPaymentService appliedPaymentService, IOrderService orderService, IStoreSettingService storeSettingService) : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, appliedPaymentService, orderService, storeSettingService) { }
public void Init() { var logger = Logger.CreateWithDefaultLog4NetConfiguration(); var syntax = new Mock<ISqlSyntaxProvider>().Object; _storeSettingService = new StoreSettingService(logger, syntax); }
/// <summary> /// Resets the currency formatter on Merchello settings change. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private static void StoreSettingServiceOnSaved(IStoreSettingService sender, SaveEventArgs <IStoreSetting> e) { StoreHelper.ResetCurrency(); }
/// <summary> /// Clears the Bazaar currency if Merchello store settings are saved. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="saveEventArgs"> /// The save event args. /// </param> private static void StoreSettingServiceOnSaved(IStoreSettingService sender, SaveEventArgs<IStoreSetting> saveEventArgs) { BazaarContentHelper.Currency = null; }
/// <summary> /// Initializes a new instance of the <see cref="ShipmentService"/> class. /// </summary> /// <param name="provider"> /// The provider. /// </param> /// <param name="repositoryFactory"> /// The repository factory. /// </param> /// <param name="logger"> /// The logger. /// </param> /// <param name="eventMessagesFactory"> /// The event messages factory. /// </param> /// <param name="storeSettingService"> /// The store setting service. /// </param> public ShipmentService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory, IStoreSettingService storeSettingService) : base(provider, repositoryFactory, logger, eventMessagesFactory) { Mandate.ParameterNotNull(storeSettingService, "storeSettingService"); _storeSettingService = storeSettingService; }
/// <summary> /// Returns an instance of the <see cref="IShipCountryRepository"/> /// </summary> /// <param name="uow"> /// The database unit of work /// </param> /// <param name="storeSettingService"> /// The store Setting Service. /// </param> /// <returns> /// The <see cref="IShipCountryRepository"/>. /// </returns> internal virtual IShipCountryRepository CreateShipCountryRepository(IDatabaseUnitOfWork uow, IStoreSettingService storeSettingService) { return(new ShipCountryRepository(uow, _disableAllCache ? _nullCacheProvider : _runtimeCacheProvider, storeSettingService)); }
/// <summary> /// Initializes a new instance of the <see cref="OrderService"/> class. /// </summary> /// <param name="provider"> /// The provider. /// </param> /// <param name="repositoryFactory"> /// The repository factory. /// </param> /// <param name="logger"> /// The logger. /// </param> /// <param name="storeSettingService"> /// The store setting service. /// </param> /// <param name="shipmentService"> /// The shipment service. /// </param> public OrderService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IStoreSettingService storeSettingService, IShipmentService shipmentService) : this(provider, repositoryFactory, logger, new TransientMessageFactory(), storeSettingService, shipmentService) { }
/// <summary> /// Initializes a new instance of the <see cref="TaxMethodService"/> class. /// </summary> /// <param name="repositoryFactory"> /// The repository factory. /// </param> /// <param name="logger"> /// The logger. /// </param> /// <param name="storeSettingService"> /// The store setting service. /// </param> public TaxMethodService(RepositoryFactory repositoryFactory, ILogger logger, IStoreSettingService storeSettingService) : this(new PetaPocoUnitOfWorkProvider(logger), repositoryFactory, logger, storeSettingService) { }
/// <summary> /// Initializes a new instance of the <see cref="OrderService"/> class. /// </summary> /// <param name="repositoryFactory"> /// The repository factory. /// </param> /// <param name="logger"> /// The logger. /// </param> /// <param name="storeSettingService"> /// The store setting service. /// </param> /// <param name="shipmentService"> /// The shipment service. /// </param> public OrderService(RepositoryFactory repositoryFactory, ILogger logger, IStoreSettingService storeSettingService, IShipmentService shipmentService) : this(new PetaPocoUnitOfWorkProvider(logger), repositoryFactory, logger, storeSettingService, shipmentService) { }
public ShipCountryService(RepositoryFactory repositoryFactory, IStoreSettingService storeSettingService) : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, storeSettingService) { }
public TaxMethodService(RepositoryFactory repositoryFactory, IStoreSettingService storeSettingService) : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, storeSettingService) { }
public void Init() { var logger = Logger.CreateWithDefaultLog4NetConfiguration(); _storeSettingService = new StoreSettingService(logger); }
/// <summary> /// Returns an instance of the <see cref="IShipCountryRepository"/> /// </summary> /// <param name="uow"> /// The database unit of work /// </param> /// <param name="storeSettingService"> /// The store Setting Service. /// </param> /// <returns> /// The <see cref="IShipCountryRepository"/>. /// </returns> internal virtual IShipCountryRepository CreateShipCountryRepository(IDatabaseUnitOfWork uow, IStoreSettingService storeSettingService) { return(new ShipCountryRepository(uow, _cacheHelper, storeSettingService, _logger, _sqlSyntax)); }
public void Init() { var warehouseService = PreTestDataWorker.WarehouseService; _warehouse = warehouseService.GetDefaultWarehouse(); StoreSettingService = PreTestDataWorker.StoreSettingService; //IStoreSetting currencyCode = new StoreSetting() //{ // Key = _currencyCodeKey, // Name = "currencyCode", // Value = "USD" //}; //StoreSettingService.Save(currencyCode); //IStoreSetting nextInvoiceNumber = new StoreSetting() //{ // Key = _nextInvoiceNumberKey, // Name = "currencyCode", // Value = "10" //}; //StoreSettingService.Save(nextInvoiceNumber); //IStoreSetting nextOrderNumber = new StoreSetting() //{ // Key = _nextOrderNumberkey, // Name = "currencyCode", // Value = "10" //}; //StoreSettingService.Save(nextOrderNumber); //IStoreSetting timeFormat = new StoreSetting() //{ // Key = _timeFormatKey, // Name = "currencyCode", // Value = "am-pm" //}; //StoreSettingService.Save(timeFormat); //IStoreSetting dateFormat = new StoreSetting() //{ // Key = _dateFormatKey, // Name = "currencyCode", // Value = "dd-mm-yyyy" //}; //StoreSettingService.Save(dateFormat); //IStoreSetting globalShippable = new StoreSetting() //{ // Key = _globalShippableKey, // Name = "currencyCode", // Value = "false" //}; //StoreSettingService.Save(globalShippable); //IStoreSetting globalShippingIsTaxable = new StoreSetting() //{ // Key = _globalShippingIsTaxableKey, // Name = "currencyCode", // Value = "false" //}; //StoreSettingService.Save(globalShippingIsTaxable); //IStoreSetting globalTaxable = new StoreSetting() //{ // Key = _globalTaxableKey, // Name = "currencyCode", // Value = "false" //}; //StoreSettingService.Save(globalTaxable); //IStoreSetting globalTrackInventory = new StoreSetting() //{ // Key = _globalTrackInventoryKey, // Name = "currencyCode", // Value = "false" //}; //StoreSettingService.Save(globalTrackInventory); }
/// <summary> /// Resets the store currency. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The save event args. /// </param> private void StoreSettingServiceSaved( IStoreSettingService sender, Umbraco.Core.Events.SaveEventArgs <Models.IStoreSetting> e) { CurrencyContext.Current.ResetCurrency(); }
/// <summary> /// Resets the store currency. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The save event args. /// </param> private void StoreSettingServiceSaved( IStoreSettingService sender, SaveEventArgs <IStoreSetting> e) { CurrencyContext.Current.ResetCurrency(); }
private void BuildGatewayContext(IGatewayProviderService gatewayProviderService, IStoreSettingService storeSettingService) { if (_notification == null) { _notification = new Lazy <INotificationContext>(() => new NotificationContext(gatewayProviderService, _resolver)); } if (_payment == null) { _payment = new Lazy <IPaymentContext>(() => new PaymentContext(gatewayProviderService, _resolver)); } if (_shipping == null) { _shipping = new Lazy <IShippingContext>(() => new ShippingContext(gatewayProviderService, storeSettingService, _resolver)); } if (_taxation == null) { _taxation = new Lazy <ITaxationContext>(() => new TaxationContext(gatewayProviderService, _resolver)); } }
/// <summary> /// Initializes a new instance of the <see cref="OrderConfirmationTrigger"/> class. /// </summary> /// <param name="merchelloContext"> /// The <see cref="IMerchelloContext"/>. /// </param> public OrderConfirmationTrigger(IMerchelloContext merchelloContext) { Mandate.ParameterNotNull(merchelloContext, "merchelloContext"); _storeSettingService = merchelloContext.Services.StoreSettingService; _shipMethodService = ((ServiceContext)merchelloContext.Services).ShipMethodService; }
/// <summary> /// Initializes a new instance of the <see cref="ShipCountryService"/> class. /// </summary> /// <param name="repositoryFactory"> /// The repository factory. /// </param> /// <param name="storeSettingService"> /// The store setting service. /// </param> public ShipCountryService(RepositoryFactory repositoryFactory, IStoreSettingService storeSettingService) : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, storeSettingService) { }