public IActionResult Configure(ConfigurationCieloModel model) { if (!ModelState.IsValid) { return(Configure()); } //load settings for a chosen store scope var storeScope = _storeContext.ActiveStoreScopeConfiguration; var cieloPaymentSettings = _settingService.LoadSetting <CieloPaymentSettings>(storeScope); cieloPaymentSettings.idEmpresa = model.idEmpresa; cieloPaymentSettings.idFilial = model.idFilial; cieloPaymentSettings.MerchantID = model.MerchantID; cieloPaymentSettings.MerchantKey = model.MerchantKey; cieloPaymentSettings.softDescriptor = "Ecommerce"; cieloPaymentSettings.UrlNotification = model.UrlNotification; _settingService.SaveSettingOverridablePerStore(cieloPaymentSettings, x => x.idEmpresa, true, storeScope, false); _settingService.SaveSettingOverridablePerStore(cieloPaymentSettings, x => x.idFilial, true, storeScope, false); _settingService.SaveSettingOverridablePerStore(cieloPaymentSettings, x => x.MerchantKey, true, storeScope, false); _settingService.SaveSettingOverridablePerStore(cieloPaymentSettings, x => x.MerchantID, true, storeScope, false); _settingService.SaveSettingOverridablePerStore(cieloPaymentSettings, x => x.softDescriptor, true, storeScope, false); _settingService.SaveSettingOverridablePerStore(cieloPaymentSettings, x => x.UrlNotification, true, storeScope, false); _settingService.SaveSetting(cieloPaymentSettings); //now clear settings cache _settingService.ClearCache(); _notificationService.SuccessNotification(_localizationService.GetResource("Admin.Plugins.Saved")); return(Configure()); }
public IActionResult Configure() { if (!_permissionService.Authorize(StandardPermissionProvider.ManagePaymentMethods)) { return(AccessDeniedView()); } //load settings for a chosen store scope var storeScope = _storeContext.ActiveStoreScopeConfiguration; var CieloPaymentSettings = _settingService.LoadSetting <CieloPaymentSettings>(storeScope); var model = new ConfigurationCieloModel { MerchantID = _CieloPaymentSettings.MerchantID, idEmpresa = _CieloPaymentSettings.idEmpresa, idFilial = _CieloPaymentSettings.idFilial, MerchantKey = _CieloPaymentSettings.MerchantKey, softDescriptor = _CieloPaymentSettings.softDescriptor, UrlNotification = _CieloPaymentSettings.UrlNotification }; return(View("~/Plugins/Payments.Cielo/Views/Configure.cshtml", model)); }