public async Task <ActionResult> Index()
        {
            var cartContext = HttpContext.GetCartContext();
            await cartContext.TryInitializeCheckoutFlowAsync(() => new CheckoutFlowInfoArgs
            {
                CheckoutFlowInfo = GetCheckoutFlowInfo()
            });

            var model = _checkoutViewModelBuilder.Build(cartContext);

            return(View(model));
        }
Пример #2
0
        public ActionResult Index()
        {
            var model = _checkoutViewModelBuilder.Build();

            if (!_checkoutService.ValidateOrder(out string message))
            {
                model.ErrorMessages.Add("cart", new List <string> {
                    message
                });
            }

            return(View(model));
        }