public override IList <string> ValidatePaymentForm(FormCollection form) { var warnings = new List <string>(); var model = new PayPalExpressPaymentInfoModel(); return(warnings); }
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()); }
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)); }
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)); }
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); }