コード例 #1
0
        public override IList <string> ValidatePaymentForm(FormCollection form)
        {
            var warnings = new List <string>();
            var model    = new PayPalExpressPaymentInfoModel();

            return(warnings);
        }
コード例 #2
0
        public ActionResult MiniShoppingCart()
        {
            var settings = Services.Settings.LoadSetting <PayPalExpressPaymentSettings>(Services.StoreContext.CurrentStore.Id);

            if (settings.ShowButtonInMiniShoppingCart)
            {
                var model = new PayPalExpressPaymentInfoModel();
                model.SubmitButtonImageUrl = GetCheckoutButtonUrl(settings);

                return(PartialView(model));
            }

            return(new EmptyResult());
        }
コード例 #3
0
        public ActionResult PaymentInfo()
        {
            var model = new PayPalExpressPaymentInfoModel();

            model.CurrentPageIsBasket = PayPalHelper.CurrentPageIsBasket(this.ControllerContext.ParentActionViewContext.RequestContext.RouteData);

            if (model.CurrentPageIsBasket)
            {
                var culture   = _services.WorkContext.WorkingLanguage.LanguageCulture;
                var buttonUrl = "https://www.paypalobjects.com/{0}/i/btn/btn_xpressCheckout.gif".FormatWith(culture.Replace("-", "_"));
                model.SubmitButtonImageUrl = PayPalHelper.CheckIfButtonExists(buttonUrl);
            }

            return(PartialView(model));
        }
コード例 #4
0
        public ActionResult PaymentInfo()
        {
            var model = new PayPalExpressPaymentInfoModel();

            model.CurrentPageIsBasket = ControllerContext.ParentActionViewContext.RequestContext.RouteData.IsRouteEqual("ShoppingCart", "Cart");

            if (model.CurrentPageIsBasket)
            {
                var settings = Services.Settings.LoadSetting <PayPalExpressPaymentSettings>(Services.StoreContext.CurrentStore.Id);

                model.SubmitButtonImageUrl = GetCheckoutButtonUrl(settings);
            }

            return(PartialView(model));
        }
コード例 #5
0
        public override IList <string> ValidatePaymentForm(FormCollection form)
        {
            var warnings = new List <string>();

            var validator = new PayPalExpressPaymentInfoValidator(Services.Localization);
            var model     = new PayPalExpressPaymentInfoModel();

            var validationResult = validator.Validate(model);

            if (!validationResult.IsValid)
            {
                foreach (var error in validationResult.Errors)
                {
                    warnings.Add(error.ErrorMessage);
                }
            }

            return(warnings);
        }