Пример #1
0
        public async Task <ActionResult> CartPaymentMethodsJson()
        {
            await _cartBuilder.GetOrCreateNewTransientCartAsync(WorkContext.CurrentStore, WorkContext.CurrentCustomer, WorkContext.CurrentLanguage, WorkContext.CurrentCurrency);

            var paymentMethods = await _cartApi.CartModuleGetPaymentMethodsAsync(_cartBuilder.Cart.Id);

            return(Json(paymentMethods.Select(pm => pm.ToWebModel()), JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public virtual async Task <ICollection <PaymentMethod> > GetAvailablePaymentMethodsAsync()
        {
            var availablePaymentMethods = new List <PaymentMethod>();

            var serviceModels = await _cartApi.CartModuleGetPaymentMethodsAsync(_cart.Id);

            foreach (var serviceModel in serviceModels)
            {
                availablePaymentMethods.Add(serviceModel.ToWebModel());
            }

            return(availablePaymentMethods);
        }