Esempio n. 1
0
        public WgShopController(IShopsService shopService, ISkuProductsService skuProductsService,
                                ICacheProvider <ProductCategory> productCategoryCache,
                                IProductRecentlyViewedService productRecentlyViewedService, ISkuAttributesService skuAttributesService,
                                ISkuAttributeOptionsService skuAttributeOptionsService, IProductCategoriesService productCategoriesService,
                                IProductsService productsService, ISkuGroupsService skuGroupsService, ISkuVariantsService skuVariantsService,
                                ISkuColourService skuColourService, ICustomSearchTermService customSearchTermService,
                                IDeliveryChargeService deliveryChargeService, ISkuService skuService, ISkuPricesService skuPricesService)
            : base(
                shopService, skuProductsService, productCategoryCache, productRecentlyViewedService,
                skuAttributesService,
                skuAttributeOptionsService, productCategoriesService, productsService, skuGroupsService,
                skuVariantsService,
                skuColourService, deliveryChargeService, skuService, skuPricesService)
        {
            _customSearchTermService = customSearchTermService;

            _b2bCheckoutService = new B2BCheckoutService(
                GetService <ITransactionService>(),
                CommerceContext, GetService <IShopsService>(),
                VisitorTrackingContext,
                GetService <ICurrencyService>(),
                ColonyContext);
        }
Esempio n. 2
0
 public CheckoutController(ICheckoutService checkoutService,
                           ISkuService skuService)
 {
     _checkoutService = checkoutService;
     _skuService      = skuService;
 }
Esempio n. 3
0
 static SKUApplication()
 {
     _skuService = ObjectContainer.Current.Resolve <IServices.ISkuService>();
 }
 public SkusController(ISkuService skuService, IErrorCodeConverter errorCodeConverter, IDataStructureConverter dataStructureConverter)
 {
     this.skuService             = skuService;
     this.errorCodeConverter     = errorCodeConverter;
     this.dataStructureConverter = dataStructureConverter;
 }
Esempio n. 5
0
 public SkuController(ISkuService service, IMapper mapper)
 {
     this.service = service;
     this.mapper  = mapper;
 }
 public SkuController(ISkuService skuService, IMapper mapper)
 {
     _skuService = skuService;
     _mapper     = mapper;
 }
Esempio n. 7
0
        private void UpdateSpecificTransactionFromTrialToLive(
            ITransactionService transactionService,
            ISerializer serializer,
            ISkuService skuService,
            services service,
            Transaction transaction)
        {
            var basket     = serializer.GetFromXml <Basket>(transaction.PurchaseXml);
            var orderLines = new List <OrderLine>();

            foreach (var lineitem in basket.Lines)
            {
                var sku  = skuService.GetById(lineitem.SkuId.Value);
                var line = new OrderLine
                {
                    ProductCode     = sku.Code,
                    SampleIndicator = "Y",
                    OrderQuantity   = lineitem.Quantity.GetValueOrDefault(0).ToString(),
                    Quantity        = lineitem.Quantity.GetValueOrDefault(0).ToString(),
                    OrderLineNumber = "-1"
                };
                orderLines.Add(line);
            }
            var checkoutService = GetService <ICheckoutService>();
            var checkout        = checkoutService.GetReadOnlyCheckoutFromXml(transaction.CheckOutXml);
            var deliveryAddress = checkout.GetAddress(AddressType.Delivery);
            var countryService  = GetService <ICountryService>();
            var country         = countryService.GetById(deliveryAddress.CountryId.Value);
            var order           = new Order
            {
                DeliveryAddress = new Address
                {
                    Address1               = deliveryAddress.Line1,
                    Address2               = deliveryAddress.Line2,
                    Address3               = deliveryAddress.Town,
                    Address4               = deliveryAddress.County,
                    Postcode               = deliveryAddress.Postcode,
                    CountryCode            = country.ISO3166Alpha2,
                    DomesticTradeIndicator = "D",
                    Name =
                        (deliveryAddress.FirstName + " " + deliveryAddress.LastName + " " + deliveryAddress.Company ??
                         "").Trim()
                },
                PriorityOrderIndicator = "N",
                Email = checkout.Person.EmailAddress,
                CustomerOrderReference = transaction.OrderNumber
            };
            var customerRef = "119303";

            switch (ColonyContext.Current.CurrentSite.SiteKey.ToLowerInvariant())
            {
            case "harlequin":
                customerRef = "119303";
                break;

            case "sanderson":
                customerRef = "102508";
                break;

            case "zoffany":
                customerRef = "129909";
                break;

            case "scion":
                customerRef = "122375";
                break;

            case "morris":
                customerRef = "129910";
                break;

            case "wg":
                customerRef = "129912";
                break;

            case "anthology":
                customerRef = "134512";
                break;
            }
            transaction.SetValue("MertexResponse", service.B2CCreateBasket(customerRef, orderLines.ToArray(), order));
            transaction.SetValue("Mertex_UpdatedFromTrialToLive", true);
            transactionService.Update(transaction);
        }
 public CalculatePromotionController(IPromotionService PromotionService, ISkuService skuService, IMapper mapper)
 {
     _PromotionService = PromotionService;
     _skuService       = skuService;
     _mapper           = mapper;
 }