Beispiel #1
0
        public InstallPipelineContext Process(InstallPipelineContext ctx)
        {
            using (var uow = VendrApi.Instance.Uow.Create())
            {
                if (!VendrApi.Instance.PaymentMethodExists(ctx.Store.Id, VendrCheckoutConstants.PaymentMethods.Aliases.ZeroValue))
                {
                    var paymentMethod = PaymentMethod.Create(uow, ctx.Store.Id, VendrCheckoutConstants.PaymentMethods.Aliases.ZeroValue, "[Vendr Checkout] Zero Value", "zeroValue");

                    paymentMethod.SetSku("VCZV01")
                    .SetTaxClass(ctx.Store.DefaultTaxClassId.Value)
                    .AllowInCountry(ctx.Store.DefaultCountryId.Value);

                    // We need to set the Continue URL to the checkout confirmation page
                    // but we create nodes as unpublished, thus without a URL so we'll
                    // have to listen for the confirmation page being published and
                    // sync it's URL accordingly

                    VendrApi.Instance.SavePaymentMethod(paymentMethod);
                }

                uow.Complete();
            }

            return(ctx);
        }
Beispiel #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (!Visible)
        {
            return;
        }

        if (ValidateFormData())
        {
            var parameters = _ucSpecific == null ? null : _ucSpecific.Parameters;

            if (parameters != null)
            {
                var method = PaymentMethod.Create(PaymentType);

                method.PaymentMethodID = PaymentMethodID;
                method.Name            = txtName.Text;
                method.Description     = txtDescription.Text;
                method.SortOrder       = txtSortOrder.Text.TryParseInt();
                method.Enabled         = chkEnabled.Checked && (_ucSpecific == null || _ucSpecific.Parameters != null);

                method.Parameters = parameters;

                PaymentService.UpdatePaymentMethod(method);
                Method = PaymentService.GetPaymentMethod(method.PaymentMethodID);
                LoadFormData(_ucSpecific != null && _ucSpecific.Parameters != null);
                OnSaved(new SavedEventArgs {
                    Enabled = method.Enabled, Name = method.Name
                });
            }
        }
    }
        protected void btnOk_Click(object sender, EventArgs e)
        {
            var type   = (PaymentType)int.Parse(ddlType.SelectedValue);
            var method = PaymentMethod.Create(type);

            method.Name        = txtName.Text;
            method.Description = txtDescription.Text;
            if (!string.IsNullOrEmpty(txtSortOrder.Text))
            {
                method.SortOrder = int.Parse(txtSortOrder.Text);
            }
            method.Enabled = type == PaymentType.Cash;
            //Some dirty magic
            if (method.Parameters.ContainsKey(AssistTemplate.CurrencyValue))
            {
                var parameters = method.Parameters;
                parameters[AssistTemplate.CurrencyValue] = "1";
                method.Parameters = parameters;
            }
            //End of dirty magic
            TrialService.TrackEvent(TrialEvents.AddPaymentMethod, method.Type.ToString());
            var id = PaymentService.AddPaymentMethod(method);

            if (id != 0)
            {
                Response.Redirect("~/Admin/PaymentMethod.aspx?PaymentMethodID=" + id);
            }
        }
Beispiel #4
0
        public override PipelineResult <InstallPipelineContext> Execute(PipelineArgs <InstallPipelineContext> args)
        {
            using (var uow = _vendrApi.Uow.Create())
            {
                if (!_vendrApi.PaymentMethodExists(args.Model.Store.Id, VendrCheckoutConstants.PaymentMethods.Aliases.ZeroValue))
                {
                    var paymentMethod = PaymentMethod.Create(uow, args.Model.Store.Id, VendrCheckoutConstants.PaymentMethods.Aliases.ZeroValue, "[Vendr Checkout] Zero Value", "zeroValue");

                    paymentMethod.SetSku("VCZV01")
                    .SetTaxClass(args.Model.Store.DefaultTaxClassId.Value)
                    .AllowInCountry(args.Model.Store.DefaultCountryId.Value);

                    // We need to set the Continue URL to the checkout confirmation page
                    // but we create nodes as unpublished, thus without a URL so we'll
                    // have to listen for the confirmation page being published and
                    // sync it's URL accordingly

                    _vendrApi.SavePaymentMethod(paymentMethod);
                }

                uow.Complete();
            }

            return(Ok());
        }
Beispiel #5
0
        public async Task <GetPaymentMethodDto> AddAsync(AddPaymentMethodDto addPaymentMethodDto, CancellationToken ct = default)
        {
            _logger.LogInformation("Add new payment method for account {AccountId}", addPaymentMethodDto.AccountId);

            PaymentMethod paymentMethod = PaymentMethod.Create(
                addPaymentMethodDto.AccountId,
                addPaymentMethodDto.Name,
                addPaymentMethodDto.CardNumber,
                addPaymentMethodDto.CardHolderFullName,
                addPaymentMethodDto.Expiration,
                addPaymentMethodDto.Cvv);

            _unitOfWork.PaymentMethodRepository.Create(paymentMethod);

            await _unitOfWork.SaveAsync(ct);

            return(_mapper.Map <GetPaymentMethodDto>(paymentMethod));
        }
Beispiel #6
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!Visible)
            {
                return;
            }
            if (!ValidateFormData())
            {
                return;
            }

            var parameters = _ucSpecific == null ? null : _ucSpecific.Parameters;

            if (parameters == null)
            {
                return;
            }

            var method = new ShippingMethod
            {
                Type                = ShippingType,
                ShippingMethodId    = ShippingMethodId,
                Name                = txtName.Text,
                Description         = txtDescription.Text,
                SortOrder           = txtSortOrder.Text.TryParseInt(),
                Enabled             = chkEnabled.Checked, //(_ucSpecific == null || _ucSpecific.Parameters != null),
                DisplayCustomFields = chkDisplayCustomFields.Checked,
                ShowInDetails       = ckbShowInDetails.Checked,
                ZeroPriceMessage    = txtZeroPriceMessage.Text
            };

            if (!ShippingMethodService.UpdateShippingMethod(method))
            {
                return;
            }
            if (ShippingType == ShippingType.eDost)
            {
                //COD
                if (SQLDataHelper.GetBoolean(parameters[EdostTemplate.EnabledCOD]))
                {
                    int idShip = 0;
                    Int32.TryParse(parameters[EdostTemplate.ShipIdCOD], out idShip);
                    var payment = PaymentService.GetPaymentMethod(idShip);
                    if (payment == null)
                    {
                        var payMethod = PaymentMethod.Create(PaymentType.CashOnDelivery);
                        payMethod.Name    = Resource.CashOnDeliveryName;
                        payMethod.Enabled = true;
                        if (payMethod.Parameters.ContainsKey(CashOnDelivery.ShippingMethodTemplate))
                        {
                            payMethod.Parameters[CashOnDelivery.ShippingMethodTemplate] = ShippingMethodId.ToString();
                        }
                        else
                        {
                            payMethod.Parameters.Add(CashOnDelivery.ShippingMethodTemplate,
                                                     ShippingMethodId.ToString());
                        }

                        var id = PaymentService.AddPaymentMethod(payMethod);
                        parameters[EdostTemplate.ShipIdCOD] = id.ToString();
                    }
                }
                else
                {
                    int idShip = 0;
                    Int32.TryParse(parameters[EdostTemplate.ShipIdCOD], out idShip);
                    PaymentService.DeletePaymentMethod(idShip);
                }

                //PickPoint
                if (SQLDataHelper.GetBoolean(parameters[EdostTemplate.EnabledPickPoint]))
                {
                    int idShip = 0;
                    Int32.TryParse(parameters[EdostTemplate.ShipIdPickPoint], out idShip);
                    var payment = PaymentService.GetPaymentMethod(idShip);
                    if (payment == null)
                    {
                        var payMethod = PaymentMethod.Create(PaymentType.PickPoint);
                        payMethod.Name    = Resource.OrderPickPointMessage;
                        payMethod.Enabled = true;
                        if (payMethod.Parameters.ContainsKey(PickPoint.ShippingMethodTemplate))
                        {
                            payMethod.Parameters[PickPoint.ShippingMethodTemplate] = ShippingMethodId.ToString();
                        }
                        else
                        {
                            payMethod.Parameters.Add(PickPoint.ShippingMethodTemplate, ShippingMethodId.ToString());
                        }
                        var id = PaymentService.AddPaymentMethod(payMethod);
                        parameters[EdostTemplate.ShipIdPickPoint] = id.ToString();
                    }
                }
                else
                {
                    int idShip = 0;
                    Int32.TryParse(parameters[EdostTemplate.ShipIdPickPoint], out idShip);
                    PaymentService.DeletePaymentMethod(idShip);
                }
            }

            if (ShippingType == ShippingType.CheckoutRu)
            {
                if (SQLDataHelper.GetBoolean(parameters[ShippingCheckoutRuTemplate.EnabledCOD]))
                {
                    int idShip = 0;
                    Int32.TryParse(parameters[ShippingCheckoutRuTemplate.ShipIdCOD], out idShip);
                    var payment = PaymentService.GetPaymentMethod(idShip);
                    if (payment == null)
                    {
                        var payMethod = PaymentMethod.Create(PaymentType.CashOnDelivery);
                        payMethod.Name    = Resource.CashOnDeliveryName;
                        payMethod.Enabled = true;
                        if (payMethod.Parameters.ContainsKey(CashOnDelivery.ShippingMethodTemplate))
                        {
                            payMethod.Parameters[CashOnDelivery.ShippingMethodTemplate] = ShippingMethodId.ToString();
                        }
                        else
                        {
                            payMethod.Parameters.Add(CashOnDelivery.ShippingMethodTemplate,
                                                     ShippingMethodId.ToString());
                        }

                        var id = PaymentService.AddPaymentMethod(payMethod);
                        parameters[ShippingCheckoutRuTemplate.ShipIdCOD] = id.ToString();
                    }
                }
                else
                {
                    int idShip = 0;
                    Int32.TryParse(parameters[ShippingCheckoutRuTemplate.ShipIdCOD], out idShip);
                    PaymentService.DeletePaymentMethod(idShip);
                }
            }

            if (ShippingType == ShippingType.Cdek)
            {
                if (SQLDataHelper.GetBoolean(parameters[CdekTemplate.EnabledCOD]))
                {
                    int idShip = 0;
                    Int32.TryParse(parameters[CdekTemplate.ShipIdCOD], out idShip);
                    var payment = PaymentService.GetPaymentMethod(idShip);
                    if (payment == null)
                    {
                        var payMethod = PaymentMethod.Create(PaymentType.CashOnDelivery);
                        payMethod.Name    = Resource.CashOnDeliveryName;
                        payMethod.Enabled = true;
                        if (payMethod.Parameters.ContainsKey(CashOnDelivery.ShippingMethodTemplate))
                        {
                            payMethod.Parameters[CashOnDelivery.ShippingMethodTemplate] = ShippingMethodId.ToString();
                        }
                        else
                        {
                            payMethod.Parameters.Add(CashOnDelivery.ShippingMethodTemplate,
                                                     ShippingMethodId.ToString());
                        }

                        var id = PaymentService.AddPaymentMethod(payMethod);
                        parameters[CdekTemplate.ShipIdCOD] = id.ToString();
                    }
                }
                else
                {
                    int idShip = 0;
                    Int32.TryParse(parameters[CdekTemplate.ShipIdCOD], out idShip);
                    PaymentService.DeletePaymentMethod(idShip);
                }
            }
            //if (ShippingType == ShippingType.ShippingNovaPoshta)
            //{
            //    //COD
            //    if (SQLDataHelper.GetBoolean(parameters[NovaPoshtaTemplate.EnabledCOD]))
            //    {
            //        int idShip = 0;
            //        Int32.TryParse(parameters[NovaPoshtaTemplate.ShipIdCOD], out idShip);
            //        var payment = PaymentService.GetPaymentMethod(idShip);
            //        if (payment == null)
            //        {
            //            var payMethod = PaymentMethod.Create(PaymentType.CashOnDelivery);
            //            payMethod.Name = Resource.CashOnDeliveryName;
            //            payMethod.Enabled = true;
            //            if (payMethod.Parameters.ContainsKey(CashOnDelivery.ShippingMethodTemplate))
            //            {
            //                payMethod.Parameters[CashOnDelivery.ShippingMethodTemplate] = ShippingMethodId.ToString();
            //            }
            //            else
            //            {
            //                payMethod.Parameters.Add(CashOnDelivery.ShippingMethodTemplate,
            //                                         ShippingMethodId.ToString());

            //            }

            //            var id = PaymentService.AddPaymentMethod(payMethod);
            //            parameters[NovaPoshtaTemplate.ShipIdCOD] = id.ToString();
            //        }
            //    }
            //    else
            //    {
            //        int idShip = 0;
            //        Int32.TryParse(parameters[NovaPoshtaTemplate.ShipIdCOD], out idShip);
            //        PaymentService.DeletePaymentMethod(idShip);
            //    }
            //}

            var payments = new System.Collections.Generic.List <int>();

            foreach (RepeaterItem item in rptrPayments.Items)
            {
                if (!((CheckBox)item.FindControl("ckbUsePayment")).Checked)
                {
                    payments.Add(SQLDataHelper.GetInt(((HiddenField)item.FindControl("hfPaymentId")).Value));
                }
            }
            ShippingMethodService.UpdateShippingPayments(ShippingMethodId, payments);

            if (ShippingMethodService.UpdateShippingParams(method.ShippingMethodId, parameters))
            {
                Method = ShippingMethodService.GetShippingMethod(method.ShippingMethodId);
                LoadFormData(true);
                OnSaved(new SavedEventArgs {
                    Enabled = method.Enabled, Name = method.Name
                });
            }
            ShippingCacheRepositiry.Delete(method.ShippingMethodId);
        }
Beispiel #7
0
        public new void SaveData()
        {
            if (_isMethodsExist)
            {
                return;
            }
            var pm = PaymentService.GetPaymentMethodByName(chbCash.Text);

            if (pm != null)
            {
                PaymentService.DeletePaymentMethod(pm.PaymentMethodId);
            }

            if (chbCash.Checked)
            {
                var method = PaymentMethod.Create(PaymentType.Cash);
                method.Name        = chbCash.Text;
                method.Description = chbCash.Text;
                method.SortOrder   = 0;
                method.Enabled     = true;
                var id = PaymentService.AddPaymentMethod(method);
            }

            pm = PaymentService.GetPaymentMethodByName(chbFizBank.Text);
            if (pm != null)
            {
                PaymentService.DeletePaymentMethod(pm.PaymentMethodId);
            }

            if (chbFizBank.Checked)
            {
                var method = PaymentMethod.Create(PaymentType.SberBank);
                method.Name        = chbFizBank.Text;
                method.Description = chbFizBank.Text;
                method.SortOrder   = 0;
                method.Enabled     = true;

                var id         = PaymentService.AddPaymentMethod(method);
                var parameters = new Dictionary <string, string>
                {
                    { SberBankTemplate.CurrencyValue, "1" },
                    { SberBankTemplate.CompanyName, SettingsBank.CompanyName },
                    { SberBankTemplate.TransAccount, SettingsBank.RS },
                    { SberBankTemplate.INN, SettingsBank.INN },
                    { SberBankTemplate.KPP, SettingsBank.KPP },
                    { SberBankTemplate.BankName, SettingsBank.BankName },
                    { SberBankTemplate.CorAccount, SettingsBank.KS },
                    { SberBankTemplate.BIK, SettingsBank.BIK }
                };
                PaymentService.UpdatePaymentParams(id, parameters);
            }

            pm = PaymentService.GetPaymentMethodByName(chbUrBank.Text);
            if (pm != null)
            {
                PaymentService.DeletePaymentMethod(pm.PaymentMethodId);
            }

            if (chbUrBank.Checked)
            {
                var method = PaymentMethod.Create(PaymentType.Bill);
                method.Name        = chbUrBank.Text;
                method.Description = chbUrBank.Text;
                method.SortOrder   = 0;
                method.Enabled     = true;

                var id         = PaymentService.AddPaymentMethod(method);
                var parameters = new Dictionary <string, string>
                {
                    { BillTemplate.Accountant, SettingsBank.Accountant },
                    { BillTemplate.CurrencyValue, "1" },
                    { BillTemplate.CompanyName, SettingsBank.CompanyName },
                    { BillTemplate.TransAccount, SettingsBank.RS },
                    { BillTemplate.CorAccount, SettingsBank.KS },
                    { BillTemplate.Address, "" },
                    { BillTemplate.Telephone, SettingsMain.Phone },
                    { BillTemplate.INN, SettingsBank.INN },
                    { BillTemplate.KPP, SettingsBank.KPP },
                    { BillTemplate.BIK, SettingsBank.BIK },
                    { BillTemplate.BankName, SettingsBank.BankName },
                    { BillTemplate.Director, SettingsBank.Director },
                    { BillTemplate.Manager, SettingsBank.Manager }
                };
                PaymentService.UpdatePaymentParams(id, parameters);
            }

            if (chbCreditCard.Checked)
            {
                SaveCreditCard();
            }

            if (chbElectronMoney.Checked)
            {
                SaveElectronMoney();
            }

            if (chbTerminals.Checked)
            {
                SaveTerminals();
            }

            pm = PaymentService.GetPaymentMethodByName(chbIPhone.Text);
            if (pm != null)
            {
                PaymentService.DeletePaymentMethod(pm.PaymentMethodId);
            }

            if (chbIPhone.Checked)
            {
                var method = PaymentMethod.Create(PaymentType.Robokassa);
                method.Name        = chbIPhone.Text;
                method.Description = chbIPhone.Text;
                method.SortOrder   = 0;
                method.Enabled     = true;

                var id         = PaymentService.AddPaymentMethod(method);
                var parameters = new Dictionary <string, string>
                {
                    { RobokassaTemplate.MerchantLogin, txtLoginRobokassaIPhone.Text },
                    { RobokassaTemplate.Password, txtPassRobokassaIPhone.Text },
                    { RobokassaTemplate.CurrencyLabel, "RUR" },
                    { RobokassaTemplate.CurrencyValue, "1" }
                };
                PaymentService.UpdatePaymentParams(id, parameters);
            }
        }
Beispiel #8
0
        private void SaveTerminals()
        {
            var pm = PaymentService.GetPaymentMethodByName(chbTerminals.Text);

            if (pm != null)
            {
                PaymentService.DeletePaymentMethod(pm.PaymentMethodId);
            }

            if (rbRobokassaTerminals.Checked)
            {
                var method = PaymentMethod.Create(PaymentType.Robokassa);
                method.Name        = chbTerminals.Text;
                method.Description = chbTerminals.Text;
                method.SortOrder   = 0;
                method.Enabled     = true;

                var id         = PaymentService.AddPaymentMethod(method);
                var parameters = new Dictionary <string, string>
                {
                    { RobokassaTemplate.MerchantLogin, txtLoginRobokassaTerminals.Text },
                    { RobokassaTemplate.Password, txtPassRobokassaTerminals.Text },
                    { RobokassaTemplate.CurrencyLabel, "RUR" },
                    { RobokassaTemplate.CurrencyValue, "1" }
                };
                PaymentService.UpdatePaymentParams(id, parameters);
            }

            if (rbAssistTerminals.Checked)
            {
                var method = PaymentMethod.Create(PaymentType.Assist);
                method.Name        = chbTerminals.Text;
                method.Description = chbTerminals.Text;
                method.SortOrder   = 0;
                method.Enabled     = true;

                var id         = PaymentService.AddPaymentMethod(method);
                var parameters = new Dictionary <string, string>
                {
                    { AssistTemplate.Login, txtLoginAssistTerminals.Text },
                    { AssistTemplate.Password, txtPassAssistTerminals.Text },
                    { AssistTemplate.MerchantID, txtShopIdAssistTerminals.Text },
                    { AssistTemplate.Sandbox, false.ToString() },
                    { AssistTemplate.CurrencyCode, "RUB" },
                    { AssistTemplate.CurrencyValue, "1" },
                    //{AssistTemplate.AssistIdCcPayment, false.ToString( ) },
                    //{AssistTemplate.CardPayment, true .ToString( ) },
                    //{AssistTemplate.PayCashPayment, false.ToString( ) },
                    //{AssistTemplate.WebMoneyPayment, false.ToString( ) },
                    //{AssistTemplate.QiwiBeelinePayment, false.ToString( ) }
                };
                PaymentService.UpdatePaymentParams(id, parameters);
            }

            if (rbPlatronTerminals.Checked)
            {
                var method = PaymentMethod.Create(PaymentType.Platron);
                method.Name        = chbTerminals.Text;
                method.Description = chbTerminals.Text;
                method.SortOrder   = 0;
                method.Enabled     = true;

                var id         = PaymentService.AddPaymentMethod(method);
                var parameters = new Dictionary <string, string>
                {
                    { PlatronTemplate.MerchantId, txtSellerIdPlatronTerminals.Text },
                    { PlatronTemplate.Currency, "RUR" },
                    { PlatronTemplate.PaymentSystem, txtPaySystemTerminals.Text },
                    { PlatronTemplate.CurrencyValue, "1" },
                    { PlatronTemplate.SecretKey, txtPayPassTerminals.Text },
                };
                PaymentService.UpdatePaymentParams(id, parameters);
            }

            if (rbZPaymentTerminals.Checked)
            {
                var method = PaymentMethod.Create(PaymentType.Platron);
                method.Name        = chbTerminals.Text;
                method.Description = chbTerminals.Text;
                method.SortOrder   = 0;
                method.Enabled     = true;

                var id         = PaymentService.AddPaymentMethod(method);
                var parameters = new Dictionary <string, string>
                {
                    { ZPaymentTemplate.Purse, txtPayPoketTerminals.Text },
                    { ZPaymentTemplate.Password, txtPassZpaymentTerminals.Text },
                    { ZPaymentTemplate.SecretKey, txtSecretKeyZpaymentTerminals.Text },
                    { ZPaymentTemplate.CurrencyValue, "1" },
                };
                PaymentService.UpdatePaymentParams(id, parameters);
            }
        }
Beispiel #9
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (!Visible)
        {
            return;
        }

        if (ValidateFormData())
        {
            var parameters = _ucSpecific == null ? null : _ucSpecific.Parameters;

            if (parameters != null)
            {
                var method = new ShippingMethod
                {
                    Type             = ShippingType,
                    ShippingMethodId = ShippingMethodID,
                    Name             = txtName.Text,
                    Description      = txtDescription.Text,
                    SortOrder        = txtSortOrder.Text.TryParseInt(),
                    Enabled          = chkEnabled.Checked && (_ucSpecific == null || _ucSpecific.Parameters != null)
                };
                if (ShippingMethodService.UpdateShippingMethod(method))
                {
                    if (ShippingType == ShippingType.eDost)
                    {
                        //COD
                        if (Convert.ToBoolean(parameters[EdostTemplate.EnabledCOD]))
                        {
                            int idShip = 0;
                            Int32.TryParse(parameters[EdostTemplate.ShipIdCOD], out idShip);
                            var payment = PaymentService.GetPaymentMethod(idShip);
                            if (payment == null)
                            {
                                var payMethod = PaymentMethod.Create(PaymentType.CashOnDelivery);
                                payMethod.Name    = Resources.Resource.CashOnDeliveryName;
                                payMethod.Enabled = true;
                                if (payMethod.Parameters.ContainsKey(CashOnDelivery.ShippingMethodTemplate))
                                {
                                    payMethod.Parameters[CashOnDelivery.ShippingMethodTemplate] = ShippingMethodID.ToString();
                                }
                                else
                                {
                                    payMethod.Parameters.Add(CashOnDelivery.ShippingMethodTemplate,
                                                             ShippingMethodID.ToString());
                                }

                                var id = PaymentService.AddPaymentMethod(payMethod);
                                parameters[EdostTemplate.ShipIdCOD] = id.ToString();
                            }
                        }
                        else
                        {
                            int idShip = 0;
                            Int32.TryParse(parameters[EdostTemplate.ShipIdCOD], out idShip);
                            PaymentService.DeletePaymentMethod(idShip);
                        }

                        //PickPoint
                        if (Convert.ToBoolean(parameters[EdostTemplate.EnabledPickPoint]))
                        {
                            int idShip = 0;
                            Int32.TryParse(parameters[EdostTemplate.ShipIdPickPoint], out idShip);
                            var payment = PaymentService.GetPaymentMethod(idShip);
                            if (payment == null)
                            {
                                var payMethod = PaymentMethod.Create(PaymentType.PickPoint);
                                payMethod.Name    = Resources.Resource.OrderPickPointMessage;
                                payMethod.Enabled = true;
                                if (payMethod.Parameters.ContainsKey(PickPoint.ShippingMethodTemplate))
                                {
                                    payMethod.Parameters[PickPoint.ShippingMethodTemplate] = ShippingMethodID.ToString();
                                }
                                else
                                {
                                    payMethod.Parameters.Add(PickPoint.ShippingMethodTemplate, ShippingMethodID.ToString());
                                }
                                var id = PaymentService.AddPaymentMethod(payMethod);
                                parameters[EdostTemplate.ShipIdPickPoint] = id.ToString();
                            }
                        }
                        else
                        {
                            int idShip = 0;
                            Int32.TryParse(parameters[EdostTemplate.ShipIdPickPoint], out idShip);
                            PaymentService.DeletePaymentMethod(idShip);
                        }
                    }

                    var payments = new System.Collections.Generic.List <int>();
                    foreach (RepeaterItem item in rptrPayments.Items)
                    {
                        if (!((CheckBox)item.FindControl("ckbUsePayment")).Checked)
                        {
                            payments.Add(Convert.ToInt32(((HiddenField)item.FindControl("hfPaymentId")).Value));
                        }
                    }
                    ShippingMethodService.UpdateShippingPayments(ShippingMethodID, payments);

                    if (ShippingMethodService.UpdateShippingParams(method.ShippingMethodId, parameters))
                    {
                        Method = ShippingMethodService.GetShippingMethod(method.ShippingMethodId);
                        LoadFormData(_ucSpecific != null && _ucSpecific.Parameters != null);
                        OnSaved(new SavedEventArgs {
                            Enabled = method.Enabled, Name = method.Name
                        });
                    }
                }
            }
        }
    }