예제 #1
0
 public GetOrderTokensCommandHandler(
     ILanguageService languageService,
     ICurrencyService currencyService,
     IProductService productService,
     IVendorService vendorService,
     IPriceFormatter priceFormatter,
     IProductAttributeParser productAttributeParser,
     ICountryService countryService,
     IAddressAttributeParser addressAttributeParser,
     IPaymentService paymentService,
     ITranslationService translationService,
     IGiftVoucherService giftVoucherService,
     TaxSettings taxSettings)
 {
     _languageService        = languageService;
     _currencyService        = currencyService;
     _productService         = productService;
     _vendorService          = vendorService;
     _priceFormatter         = priceFormatter;
     _productAttributeParser = productAttributeParser;
     _countryService         = countryService;
     _addressAttributeParser = addressAttributeParser;
     _paymentService         = paymentService;
     _translationService     = translationService;
     _giftVoucherService     = giftVoucherService;
     _taxSettings            = taxSettings;
 }
예제 #2
0
 public GiftVoucherController(
     IGiftVoucherViewModelService giftVoucherViewModelService,
     IGiftVoucherService giftVoucherService,
     ITranslationService translationService)
 {
     _giftVoucherViewModelService = giftVoucherViewModelService;
     _giftVoucherService          = giftVoucherService;
     _translationService          = translationService;
 }
예제 #3
0
 //inject the services
 public BaseService(IGiftVoucherService giftService, IDiscountVoucherService discountService,
                    IValueVoucherService valueService, IVoucherRepository voucherRepository, ILogger <BaseService> logger)
 {
     this._giftVoucherService     = giftService;
     this._discountVoucherService = discountService;
     this._valueVoucherService    = valueService;
     this._baseRepository         = voucherRepository;
     this._logger = logger;
 }
 public ActivatedValueForPurchasedGiftVouchersCommandHandler(
     IGiftVoucherService giftVoucherService,
     ILanguageService languageService,
     IMessageProviderService messageProviderService)
 {
     _giftVoucherService     = giftVoucherService;
     _languageService        = languageService;
     _messageProviderService = messageProviderService;
 }
 public InsertOrderItemCommandHandler(
     IMediator mediator,
     IOrderService orderService,
     IGiftVoucherService giftVoucherService,
     IInventoryManageService inventoryManageService)
 {
     _mediator               = mediator;
     _orderService           = orderService;
     _giftVoucherService     = giftVoucherService;
     _inventoryManageService = inventoryManageService;
 }
 public GiftVoucherViewModelService(
     IGiftVoucherService giftVoucherService, IOrderService orderService,
     IPriceFormatter priceFormatter, IMessageProviderService messageProviderService,
     IDateTimeService dateTimeService,
     ICurrencyService currencyService,
     LanguageSettings languageSettings,
     ITranslationService translationService, ILanguageService languageService,
     ICustomerActivityService customerActivityService, IWorkContext workContext)
 {
     _giftVoucherService      = giftVoucherService;
     _orderService            = orderService;
     _priceFormatter          = priceFormatter;
     _messageProviderService  = messageProviderService;
     _dateTimeService         = dateTimeService;
     _currencyService         = currencyService;
     _languageSettings        = languageSettings;
     _translationService      = translationService;
     _languageService         = languageService;
     _customerActivityService = customerActivityService;
     _workContext             = workContext;
 }
 public GetOrderDetailsHandler(
     IDateTimeService dateTimeService,
     IProductService productService,
     IProductAttributeParser productAttributeParser,
     ITranslationService translationService,
     IShipmentService shipmentService,
     IPaymentService paymentService,
     IPaymentTransactionService paymentTransactionService,
     IPriceFormatter priceFormatter,
     IGiftVoucherService giftVoucherService,
     IOrderService orderService,
     IPictureService pictureService,
     IDownloadService downloadService,
     IOrderStatusService orderStatusService,
     IMediator mediator,
     CatalogSettings catalogSettings,
     OrderSettings orderSettings,
     PdfSettings pdfSettings,
     TaxSettings taxSettings)
 {
     _dateTimeService           = dateTimeService;
     _productService            = productService;
     _productAttributeParser    = productAttributeParser;
     _translationService        = translationService;
     _shipmentService           = shipmentService;
     _paymentService            = paymentService;
     _paymentTransactionService = paymentTransactionService;
     _priceFormatter            = priceFormatter;
     _giftVoucherService        = giftVoucherService;
     _orderService       = orderService;
     _pictureService     = pictureService;
     _downloadService    = downloadService;
     _orderStatusService = orderStatusService;
     _mediator           = mediator;
     _orderSettings      = orderSettings;
     _catalogSettings    = catalogSettings;
     _pdfSettings        = pdfSettings;
     _taxSettings        = taxSettings;
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="workContext">Work 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="giftVoucherService">Gift voucher service</param>
 /// <param name="loyaltyPointsService">Loyalty points service</param>
 /// <param name="productService">Product service</param>
 /// <param name="currencyService">Currency service</param>
 /// <param name="groupService">Group</param>
 /// <param name="taxSettings">Tax settings</param>
 /// <param name="loyaltyPointsSettings">Loyalty points settings</param>
 /// <param name="shippingSettings">Shipping settings</param>
 /// <param name="shoppingCartSettings">Shopping cart settings</param>
 /// <param name="catalogSettings">Catalog settings</param>
 public OrderCalculationService(IWorkContext workContext,
                                IPricingService priceCalculationService,
                                ITaxService taxService,
                                IShippingService shippingService,
                                IPaymentService paymentService,
                                ICheckoutAttributeParser checkoutAttributeParser,
                                IDiscountService discountService,
                                IGiftVoucherService giftVoucherService,
                                ILoyaltyPointsService loyaltyPointsService,
                                IProductService productService,
                                ICurrencyService currencyService,
                                IGroupService groupService,
                                TaxSettings taxSettings,
                                LoyaltyPointsSettings loyaltyPointsSettings,
                                ShippingSettings shippingSettings,
                                ShoppingCartSettings shoppingCartSettings,
                                CatalogSettings catalogSettings)
 {
     _workContext             = workContext;
     _pricingService          = priceCalculationService;
     _taxService              = taxService;
     _shippingService         = shippingService;
     _paymentService          = paymentService;
     _checkoutAttributeParser = checkoutAttributeParser;
     _discountService         = discountService;
     _giftVoucherService      = giftVoucherService;
     _loyaltyPointsService    = loyaltyPointsService;
     _productService          = productService;
     _currencyService         = currencyService;
     _groupService            = groupService;
     _taxSettings             = taxSettings;
     _loyaltyPointsSettings   = loyaltyPointsSettings;
     _shippingSettings        = shippingSettings;
     _shoppingCartSettings    = shoppingCartSettings;
     _catalogSettings         = catalogSettings;
 }
 public void Init()
 {
     _repositoryMock = new Mock <IRepository <GiftVoucher> >();
     _mediatorMock   = new Mock <IMediator>();
     _service        = new GiftVoucherService(_repositoryMock.Object, _mediatorMock.Object);
 }
예제 #10
0
        public virtual async Task <IActionResult> RemoveGiftVoucherCode(string giftVoucherId, [FromServices] IGiftVoucherService giftVoucherService)
        {
            if (!string.IsNullOrEmpty(giftVoucherId))
            {
                //remove card
                var giftvoucher = await giftVoucherService.GetGiftVoucherById(giftVoucherId);

                if (giftvoucher != null)
                {
                    var result = _workContext.CurrentCustomer.RemoveCouponCode(SystemCustomerFieldNames.GiftVoucherCoupons, giftvoucher.Code);
                    await _userFieldService.SaveField(_workContext.CurrentCustomer, SystemCustomerFieldNames.GiftVoucherCoupons, result);
                }
            }
            var cart = _shoppingCartService.GetShoppingCart(_workContext.CurrentStore.Id, PrepareCartTypes());

            var model = await _mediator.Send(new GetShoppingCart()
            {
                Cart           = cart,
                Customer       = _workContext.CurrentCustomer,
                Currency       = _workContext.WorkingCurrency,
                Language       = _workContext.WorkingLanguage,
                Store          = _workContext.CurrentStore,
                TaxDisplayType = _workContext.TaxDisplayType
            });

            return(Json(new
            {
                model = model
            }));
        }
예제 #11
0
 public Basket(IGiftVoucherService giftVoucherService, IProductService productService)
 {
     _giftVoucherService = giftVoucherService;
     _productService     = productService;
 }