예제 #1
0
        public ActionResult Configure(PayPalStandardConfigurationModel 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 <PayPalStandardPaymentSettings>(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());
        }
예제 #2
0
        public ActionResult Configure(PayPalStandardConfigurationModel model, FormCollection form)
        {
            var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData);
            var storeScope = this.GetActiveStoreScopeConfiguration(Services.StoreService, Services.WorkContext);
            var settings   = Services.Settings.LoadSetting <PayPalStandardPaymentSettings>(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(PayPalStandardProvider.SystemName, false));
        }
예제 #3
0
        public ActionResult Configure(PayPalStandardPaymentSettings settings, int storeScope)
        {
            var model = new PayPalStandardConfigurationModel();

            model.Copy(settings, true);

            PrepareConfigurationModel(model, storeScope);

            return(View(model));
        }
예제 #4
0
        public ActionResult Configure()
        {
            var model      = new PayPalStandardConfigurationModel();
            int storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _services.WorkContext);
            var settings   = _services.Settings.LoadSetting <PayPalStandardPaymentSettings>(storeScope);

            model.Copy(settings, true);

            var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData);

            storeDependingSettingHelper.GetOverrideKeys(settings, model, storeScope, _services.Settings);

            return(View(model));
        }
        public ActionResult Configure()
        {
            var model = new PayPalStandardConfigurationModel();

            model.UseSandbox                = _paypalStandardSettings.UseSandbox;
            model.BusinessEmail             = _paypalStandardSettings.BusinessEmail;
            model.PdtToken                  = _paypalStandardSettings.PdtToken;
            model.PdtValidateOrderTotal     = _paypalStandardSettings.PdtValidateOrderTotal;
            model.AdditionalFee             = _paypalStandardSettings.AdditionalFee;
            model.AdditionalFeePercentage   = _paypalStandardSettings.AdditionalFeePercentage;
            model.PassProductNamesAndTotals = _paypalStandardSettings.PassProductNamesAndTotals;
            model.EnableIpn                 = _paypalStandardSettings.EnableIpn;
            model.IpnUrl = _paypalStandardSettings.IpnUrl;

            return(View(model));
        }
        public ActionResult Configure()
        {
            var model      = new PayPalStandardConfigurationModel();
            int storeScope = this.GetActiveStoreScopeConfiguration(Services.StoreService, Services.WorkContext);
            var settings   = Services.Settings.LoadSetting <PayPalStandardPaymentSettings>(storeScope);

            model.Copy(settings, true);

            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));
        }
        public ActionResult Configure(PayPalStandardConfigurationModel model, FormCollection form)
        {
            if (!ModelState.IsValid)
            {
                return(Configure());
            }

            //save settings
            _paypalStandardSettings.UseSandbox                = model.UseSandbox;
            _paypalStandardSettings.BusinessEmail             = model.BusinessEmail;
            _paypalStandardSettings.PdtToken                  = model.PdtToken;
            _paypalStandardSettings.PdtValidateOrderTotal     = model.PdtValidateOrderTotal;
            _paypalStandardSettings.AdditionalFee             = model.AdditionalFee;
            _paypalStandardSettings.AdditionalFeePercentage   = model.AdditionalFeePercentage;
            _paypalStandardSettings.PassProductNamesAndTotals = model.PassProductNamesAndTotals;
            _paypalStandardSettings.EnableIpn                 = model.EnableIpn;
            _paypalStandardSettings.IpnUrl = model.IpnUrl;
            _settingService.SaveSetting(_paypalStandardSettings);

            return(View(model));
        }