/// <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;
        }
Example #8
0
        /// <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();
        }
Example #10
0
        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;
        }
Example #11
0
        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));

        }
Example #12
0
        /// <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;
        }
Example #14
0
        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;
        }
Example #15
0
        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));
        }
Example #16
0
 /// <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)
 {
 }
Example #17
0
 public ShipCountryFactory(IStoreSettingService storeSettingService)
 {
     _storeSettingService = storeSettingService;
 }
Example #18
0
        /// <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;
 }
Example #20
0
        /// <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="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();
 }
Example #22
0
 public void Init()
 {
     _storeSettingService = new StoreSettingService();
 }
Example #23
0
        /// <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;
        }
Example #26
0
 /// <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)
 {
 }
Example #27
0
        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;
        }
Example #28
0
 /// <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;
 }
Example #29
0
 /// <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 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();
 }
 /// <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);
 }
Example #34
0
 public OrderService(RepositoryFactory repositoryFactory, IStoreSettingService storeSettingService, IShipmentService shipmentService)
     : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, storeSettingService, shipmentService)
 {
 }
 public void Init()
 {
     _settingsService = PreTestDataWorker.StoreSettingService;
 }
Example #36
0
 internal InvoiceService(RepositoryFactory repositoryFactory, IAppliedPaymentService appliedPaymentService, IOrderService orderService, IStoreSettingService storeSettingService)
     : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, appliedPaymentService, orderService, storeSettingService)
 {
 }
Example #37
0
 public void Init()
 {
     var logger = Logger.CreateWithDefaultLog4NetConfiguration();
     var syntax = new Mock<ISqlSyntaxProvider>().Object;
     _storeSettingService = new StoreSettingService(logger, syntax);
 }
        /// <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();
        }
Example #39
0
 /// <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();
 }
Example #40
0
 /// <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;
 }
Example #41
0
 /// <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));
 }
Example #43
0
 /// <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)
 {
 }
Example #44
0
 /// <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)
 {
 }
Example #45
0
 /// <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)
 {
 }
 /// <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)
 {
 }
Example #48
0
 public TaxMethodService(RepositoryFactory repositoryFactory, IStoreSettingService storeSettingService)
     : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, storeSettingService)
 {
 }
Example #49
0
        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));
 }
Example #51
0
        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);
        }
 public void Init()
 {
     _storeSettingService = new StoreSettingService();
 }
Example #53
0
 /// <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();
 }
 public void Init()
 {
     _settingsService = PreTestDataWorker.StoreSettingService;
 }
 /// <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();
 }
Example #56
0
        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));
            }
        }
Example #57
0
 /// <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);
 }
Example #58
0
        /// <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;
        }
Example #59
0
 /// <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;
 }
Example #60
0
 /// <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)
 {
     
 }