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() { 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); }