コード例 #1
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="rphRepository">LoyaltyPointsHistory repository</param>
 /// <param name="loyaltyPointsSettings">Loyalty points settings</param>
 /// <param name="mediator">Mediator</param>
 public LoyaltyPointsService(IRepository <LoyaltyPointsHistory> rphRepository,
                             LoyaltyPointsSettings loyaltyPointsSettings,
                             IMediator mediator)
 {
     _rphRepository         = rphRepository;
     _loyaltyPointsSettings = loyaltyPointsSettings;
     _mediator = mediator;
 }
コード例 #2
0
 public CustomerRegisteredEventHandler(
     ITranslationService translationService,
     ILoyaltyPointsService loyaltyPointsService,
     LoyaltyPointsSettings loyaltyPointsSettings
     )
 {
     _translationService    = translationService;
     _loyaltyPointsService  = loyaltyPointsService;
     _loyaltyPointsSettings = loyaltyPointsSettings;
 }
コード例 #3
0
 public GetNavigationHandler(
     CustomerSettings customerSettings,
     LoyaltyPointsSettings loyaltyPointsSettings,
     OrderSettings orderSettings,
     VendorSettings vendorSettings)
 {
     _customerSettings      = customerSettings;
     _loyaltyPointsSettings = loyaltyPointsSettings;
     _orderSettings         = orderSettings;
     _vendorSettings        = vendorSettings;
 }
コード例 #4
0
 public GetCustomerLoyaltyPointsHandler(ILoyaltyPointsService loyaltyPointsService, IDateTimeService dateTimeService,
                                        ICurrencyService currencyService, IPriceFormatter priceFormatter, IOrderCalculationService orderTotalCalculationService,
                                        LoyaltyPointsSettings loyaltyPointsSettings)
 {
     _loyaltyPointsService         = loyaltyPointsService;
     _dateTimeService              = dateTimeService;
     _currencyService              = currencyService;
     _priceFormatter               = priceFormatter;
     _orderTotalCalculationService = orderTotalCalculationService;
     _loyaltyPointsSettings        = loyaltyPointsSettings;
 }
コード例 #5
0
 public GetPaymentMethodHandler(ILoyaltyPointsService loyaltyPointsService,
                                IOrderCalculationService orderTotalCalculationService,
                                ICurrencyService currencyService,
                                IPriceFormatter priceFormatter,
                                IPaymentService paymentService,
                                ITaxService taxService,
                                LoyaltyPointsSettings loyaltyPointsSettings,
                                PaymentSettings paymentSettings)
 {
     _loyaltyPointsService         = loyaltyPointsService;
     _orderTotalCalculationService = orderTotalCalculationService;
     _currencyService       = currencyService;
     _priceFormatter        = priceFormatter;
     _paymentService        = paymentService;
     _taxService            = taxService;
     _loyaltyPointsSettings = loyaltyPointsSettings;
     _paymentSettings       = paymentSettings;
 }
コード例 #6
0
 public OrderStatusCommandHandler(
     IOrderService orderService,
     ICustomerService customerService,
     IPdfService pdfService,
     IMessageProviderService messageProviderService,
     IVendorService vendorService,
     IMediator mediator,
     OrderSettings orderSettings,
     LoyaltyPointsSettings loyaltyPointsSettings)
 {
     _orderService           = orderService;
     _customerService        = customerService;
     _pdfService             = pdfService;
     _messageProviderService = messageProviderService;
     _vendorService          = vendorService;
     _mediator              = mediator;
     _orderSettings         = orderSettings;
     _loyaltyPointsSettings = loyaltyPointsSettings;
 }
コード例 #7
0
 public GetOrderTotalsHandler(
     IOrderCalculationService orderTotalCalculationService,
     ICurrencyService currencyService,
     IPriceFormatter priceFormatter,
     IPaymentService paymentService,
     ITaxService taxService,
     IMediator mediator,
     TaxSettings taxSettings,
     LoyaltyPointsSettings loyaltyPointsSettings)
 {
     _orderTotalCalculationService = orderTotalCalculationService;
     _currencyService       = currencyService;
     _priceFormatter        = priceFormatter;
     _paymentService        = paymentService;
     _taxService            = taxService;
     _mediator              = mediator;
     _taxSettings           = taxSettings;
     _loyaltyPointsSettings = loyaltyPointsSettings;
 }
コード例 #8
0
        //My account / Loyalty points
        public virtual async Task <IActionResult> CustomerLoyaltyPoints([FromServices] LoyaltyPointsSettings loyaltyPointsSettings)
        {
            if (!await _groupService.IsRegistered(_workContext.CurrentCustomer))
            {
                return(Challenge());
            }

            if (!loyaltyPointsSettings.Enabled)
            {
                return(RedirectToRoute("CustomerInfo"));
            }

            var model = await _mediator.Send(new GetCustomerLoyaltyPoints()
            {
                Customer = _workContext.CurrentCustomer,
                Store    = _workContext.CurrentStore,
                Currency = _workContext.WorkingCurrency
            });

            return(View(model));
        }
コード例 #9
0
 /// <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;
 }
コード例 #10
0
 public void Init()
 {
     _settings = new LoyaltyPointsSettings();
     _handler  = new CalculateLoyaltyPointsCommandHandler(_settings);
 }
コード例 #11
0
 public static SalesSettingsModel.LoyaltyPointsSettingsModel ToModel(this LoyaltyPointsSettings entity)
 {
     return(entity.MapTo <LoyaltyPointsSettings, SalesSettingsModel.LoyaltyPointsSettingsModel>());
 }
コード例 #12
0
 public static LoyaltyPointsSettings ToEntity(this SalesSettingsModel.LoyaltyPointsSettingsModel model, LoyaltyPointsSettings destination)
 {
     return(model.MapTo(destination));
 }
コード例 #13
0
 public CalculateLoyaltyPointsCommandHandler(LoyaltyPointsSettings loyaltyPointsSettings)
 {
     _loyaltyPointsSettings = loyaltyPointsSettings;
 }