public ActionResult Configure(PayPalExpressConfigurationModel model, FormCollection form) { if (!ModelState.IsValid) { return(Configure()); } ModelState.Clear(); var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData); int storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _services.WorkContext); var settings = _services.Settings.LoadSetting <PayPalExpressPaymentSettings>(storeScope); model.Copy(settings, false); storeDependingSettingHelper.UpdateSettings(settings, form, storeScope, _services.Settings); // multistore context not possible, see IPN handling _services.Settings.SaveSetting(settings, x => x.UseSandbox, 0, false); _services.Settings.ClearCache(); NotifySuccess(_services.Localization.GetResource("Plugins.Payments.PayPal.ConfigSaveNote")); return(Configure()); }
public ActionResult Configure(PayPalExpressConfigurationModel model, FormCollection form) { var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData); var storeScope = this.GetActiveStoreScopeConfiguration(Services.StoreService, Services.WorkContext); var settings = Services.Settings.LoadSetting <PayPalExpressPaymentSettings>(storeScope); if (!ModelState.IsValid) { return(Configure(settings, storeScope)); } ModelState.Clear(); model.Copy(settings, false); using (Services.Settings.BeginScope()) { storeDependingSettingHelper.UpdateSettings(settings, form, storeScope, Services.Settings); } using (Services.Settings.BeginScope()) { // Multistore context not possible, see IPN handling. Services.Settings.SaveSetting(settings, x => x.UseSandbox, 0, false); } NotifySuccess(T("Admin.Common.DataSuccessfullySaved")); return(RedirectToConfiguration(PayPalExpressProvider.SystemName, false)); }
public ActionResult Configure(PayPalExpressConfigurationModel model, FormCollection form) { if (!ModelState.IsValid) { return(Configure()); } //save settings _payPalExpressPaymentSettings.UseSandbox = model.UseSandbox; _payPalExpressPaymentSettings.TransactMode = (TransactMode)model.TransactMode; _payPalExpressPaymentSettings.ApiAccountName = model.ApiAccountName; _payPalExpressPaymentSettings.ApiAccountPassword = model.ApiAccountPassword; _payPalExpressPaymentSettings.Signature = model.Signature; _payPalExpressPaymentSettings.AdditionalFee = model.AdditionalFee; _payPalExpressPaymentSettings.AdditionalFeePercentage = model.AdditionalFeePercentage; _payPalExpressPaymentSettings.DisplayCheckoutButton = model.DisplayCheckoutButton; _payPalExpressPaymentSettings.ConfirmedShipment = model.ConfirmedShipment; _payPalExpressPaymentSettings.NoShipmentAddress = model.NoShipmentAddress; _payPalExpressPaymentSettings.CallbackTimeout = model.CallbackTimeout; _payPalExpressPaymentSettings.DefaultShippingPrice = model.DefaultShippingPrice; _settingService.SaveSetting(_payPalExpressPaymentSettings); model.TransactModeValues = TransactModeValues(_payPalExpressPaymentSettings.TransactMode); return(View(model)); }
public ActionResult Configure(PayPalExpressPaymentSettings settings, int storeScope) { var model = new PayPalExpressConfigurationModel(); model.Copy(settings, true); PrepareConfigurationModel(model, storeScope); return(View(model)); }
public ActionResult Configure() { var model = new PayPalExpressConfigurationModel(); int storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _services.WorkContext); var settings = _services.Settings.LoadSetting <PayPalExpressPaymentSettings>(storeScope); model.Copy(settings, true); model.TransactModeValues = TransactModeValues(settings.TransactMode); var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData); storeDependingSettingHelper.GetOverrideKeys(settings, model, storeScope, _services.Settings); return(View(model)); }
public ActionResult Configure() { var model = new PayPalExpressConfigurationModel(); model.UseSandbox = _payPalExpressPaymentSettings.UseSandbox; model.TransactMode = Convert.ToInt32(_payPalExpressPaymentSettings.TransactMode); model.TransactModeValues = TransactModeValues(_payPalExpressPaymentSettings.TransactMode); model.ApiAccountName = _payPalExpressPaymentSettings.ApiAccountName; model.ApiAccountPassword = _payPalExpressPaymentSettings.ApiAccountPassword; model.Signature = _payPalExpressPaymentSettings.Signature; model.AdditionalFee = _payPalExpressPaymentSettings.AdditionalFee; model.AdditionalFeePercentage = _payPalExpressPaymentSettings.AdditionalFeePercentage; model.DisplayCheckoutButton = _payPalExpressPaymentSettings.DisplayCheckoutButton; model.ConfirmedShipment = _payPalExpressPaymentSettings.ConfirmedShipment; model.NoShipmentAddress = _payPalExpressPaymentSettings.NoShipmentAddress; model.CallbackTimeout = _payPalExpressPaymentSettings.CallbackTimeout; model.DefaultShippingPrice = _payPalExpressPaymentSettings.DefaultShippingPrice; return(View(model)); }
public ActionResult Configure() { var model = new PayPalExpressConfigurationModel(); int storeScope = this.GetActiveStoreScopeConfiguration(Services.StoreService, Services.WorkContext); var settings = Services.Settings.LoadSetting <PayPalExpressPaymentSettings>(storeScope); model.Copy(settings, true); model.TransactModeValues = TransactModeValues(settings.TransactMode); model.AvailableSecurityProtocols = PayPalService.GetSecurityProtocols() .Select(x => new SelectListItem { Value = ((int)x.Key).ToString(), Text = x.Value }) .ToList(); var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData); storeDependingSettingHelper.GetOverrideKeys(settings, model, storeScope, Services.Settings); return(View(model)); }