예제 #1
0
        public ActionResult Configure(PaymentSettingModel model)
        {
            var stripeApiKey = _settingDictionaryService.GetSettingDictionary(CacheHelper.Settings.ID, StripePlugin.SettingStripeApiKey);

            stripeApiKey.Value = model.StripeApiKey;
            _settingDictionaryService.SaveSettingDictionary(stripeApiKey);

            var stripeClientID = _settingDictionaryService.GetSettingDictionary(CacheHelper.Settings.ID, StripePlugin.SettingStripeClientID);

            stripeClientID.Value = model.StripeClientID;
            _settingDictionaryService.SaveSettingDictionary(stripeClientID);

            var stripePublishableKey = _settingDictionaryService.GetSettingDictionary(CacheHelper.Settings.ID, StripePlugin.SettingStripePublishableKey);

            stripePublishableKey.Value = model.StripePublishableKey;
            _settingDictionaryService.SaveSettingDictionary(stripePublishableKey);

            _unitOfWorkAsync.SaveChanges();

            _dataCacheService.RemoveCachedItem(CacheKeys.SettingDictionary);
            _dataCacheService.RemoveCachedItem(CacheKeys.Settings);

            TempData[TempDataKeys.UserMessage] = "[[[Plugin updated!]]]";

            return(RedirectToAction("Plugins", "Plugin", new { area = "Admin" }));
        }
예제 #2
0
        public async Task <ActionResult> Configure(string trackingID)
        {
            var settingExisting = _settingDictionaryService.GetSettingDictionary(CacheHelper.Settings.ID, GoogleAnalyticsPlugin.SettingTrackingID);

            settingExisting.Value = trackingID;

            _settingDictionaryService.SaveSettingDictionary(settingExisting);

            await _unitOfWorkAsync.SaveChangesAsync();

            _dataCacheService.RemoveCachedItem(CacheKeys.SettingDictionary);

            TempData[TempDataKeys.UserMessage] = "[[[Plugin updated!]]]";

            return(RedirectToAction("Plugins", "Plugin", new { area = "Admin" }));
        }