Ejemplo n.º 1
0
        private ConfigData LoadConfig(out string selectedName)
        {
            selectedName = base.Request.Form["ddlSms"];
            this.txtSelectedName.Value = selectedName;
            this.txtConfigData.Value   = "";
            if (string.IsNullOrEmpty(selectedName) || selectedName.Length == 0)
            {
                return(null);
            }
            ConfigablePlugin configablePlugin = SMSSender.CreateInstance(selectedName);

            if (configablePlugin == null)
            {
                return(null);
            }
            ConfigData configData = configablePlugin.GetConfigData(base.Request.Form);

            if (configData != null)
            {
                this.txtConfigData.Value = configData.SettingsXml;
            }

            Globals.AppendLog(new Dictionary <string, string>(), "SMSSettings-LoadConfig:" + selectedName + "," + configData.ToString(), "", "", "/log/SMSSettings.txt");
            return(configData);
        }
Ejemplo n.º 2
0
        private ConfigData LoadConfig(out string selectedName)
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            selectedName = masterSettings.SMSSender;
            //selectedName = base.Request.Form["ddlSms"];
            this.txtSelectedName.Value = selectedName;
            this.txtConfigData.Value   = "";
            if (string.IsNullOrEmpty(selectedName) || selectedName.Length == 0)
            {
                return(null);
            }
            ConfigablePlugin configablePlugin = SMSSender.CreateInstance(selectedName);

            if (configablePlugin == null)
            {
                return(null);
            }
            ConfigData configData = configablePlugin.GetConfigData(base.Request.Form);

            if (configData != null)
            {
                this.txtConfigData.Value = configData.SettingsXml;
            }
            return(configData);
        }
Ejemplo n.º 3
0
        private ConfigData LoadConfig(out string selectedName)
        {
            selectedName = base.Request.Form["ddlEmails"];
            this.txtSelectedName.Value = selectedName;
            this.txtConfigData.Value   = "";
            ConfigData result;

            if (string.IsNullOrEmpty(selectedName) || selectedName.Length == 0)
            {
                result = null;
            }
            else
            {
                ConfigablePlugin plugin = EmailSender.CreateInstance(selectedName);
                if (plugin == null)
                {
                    result = null;
                }
                else
                {
                    ConfigData configData = plugin.GetConfigData(base.Request.Form);
                    if (configData != null)
                    {
                        this.txtConfigData.Value = configData.SettingsXml;
                    }
                    result = configData;
                }
            }
            return(result);
        }
Ejemplo n.º 4
0
        private ConfigData LoadConfig(out string selectedName)
        {
            selectedName = base.Request.Form["ddlPayments"];
            this.txtSelectedName.Value = selectedName;
            this.txtConfigData.Value   = "";
            if (string.IsNullOrEmpty(selectedName) || selectedName.Length == 0)
            {
                return(null);
            }
            //判断为微信扫码支付
            if (selectedName == "微信扫码支付")
            {
                return(new ConfigData());
            }
            ConfigablePlugin configablePlugin = PaymentRequest.CreateInstance(selectedName);

            if (configablePlugin == null)
            {
                return(null);
            }
            ConfigData configData = configablePlugin.GetConfigData(base.Request.Form);

            if (configData != null)
            {
                this.txtConfigData.Value = configData.SettingsXml;
            }
            return(configData);
        }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.siteSettings = SettingsManager.GetMasterSettings();
     if (this.siteSettings.IsDemoSite)
     {
         this.ShowMsg("演示站点,不允许编辑支付方式", true);
     }
     else if (!int.TryParse(this.Page.Request.QueryString["modeId"], out this.modeId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.item = SalesHelper.GetPaymentMode(this.modeId);
         if (this.item == null)
         {
             base.GotoResourceNotFound();
         }
         else
         {
             this.btnUpdate.Click += this.btnUpdate_Click;
             if (!this.Page.IsPostBack)
             {
                 Globals.EntityCoding(this.item, false);
                 this.txtSelectedName.Value = this.item.Gateway.ToLower();
                 ConfigablePlugin configablePlugin = PaymentRequest.CreateInstance(this.item.Gateway.ToLower());
                 if (configablePlugin == null)
                 {
                     base.GotoResourceNotFound();
                 }
                 else
                 {
                     Globals.EntityCoding(this.item, false);
                     this.txtSelectedName.Value = this.item.Gateway.ToLower();
                     ConfigData configData = new ConfigData(HiCryptographer.Decrypt(this.item.Settings));
                     this.configXml                     = configData.SettingsXml;
                     this.txtConfigData.Value           = this.EncodeingConfig(configData.SettingsXml, configablePlugin.GetHiddenPartConfigNames());
                     this.txtName.Text                  = this.item.Name;
                     this.fcContent.Text                = this.item.Description;
                     this.radiIsUseInpour.SelectedValue = this.item.IsUseInpour;
                 }
             }
         }
     }
 }
Ejemplo n.º 6
0
        private ConfigData LoadConfig()
        {
            txtSelectedName.Value = openIdType;
            txtConfigData.Value   = "";
            ConfigablePlugin plugin = OpenIdService.CreateInstance(openIdType);

            if (plugin == null)
            {
                return(null);
            }
            ConfigData configData = plugin.GetConfigData(base.Request.Form);

            if (configData != null)
            {
                txtConfigData.Value = configData.SettingsXml;
            }
            return(configData);
        }
Ejemplo n.º 7
0
        private ConfigData LoadConfig(out string selectedName)
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            selectedName = masterSettings.SMSSender;
            if (string.IsNullOrEmpty(selectedName) || selectedName.Length == 0)
            {
                return(null);
            }
            ConfigablePlugin configablePlugin = SMSSender.CreateInstance(selectedName);

            if (configablePlugin == null)
            {
                return(null);
            }
            ConfigData configData = configablePlugin.GetConfigData(base.Request.Form);

            return(configData);
        }
Ejemplo n.º 8
0
        private ConfigData LoadConfig(out string selectedName)
        {
            selectedName          = Request.Form["ddlPayments"];
            txtSelectedName.Value = selectedName;
            txtConfigData.Value   = "";
            if (string.IsNullOrEmpty(selectedName) || (selectedName.Length == 0))
            {
                return(null);
            }
            ConfigablePlugin plugin = PaymentRequest.CreateInstance(selectedName);

            if (plugin == null)
            {
                return(null);
            }
            ConfigData configData = plugin.GetConfigData(Request.Form);

            if (configData != null)
            {
                txtConfigData.Value = configData.SettingsXml;
            }
            return(configData);
        }
Ejemplo n.º 9
0
        private ConfigData LoadConfig(out string selectedName)
        {
            selectedName = base.Request.Form["ddlPayments"];
            this.txtSelectedName.Value = selectedName;
            this.txtConfigData.Value   = "";
            if (selectedName.Equals("hishop.plugins.payment.bankuniongateway.bankuniongetwayrequest") && this.fileBankUnionCert.HasFile)
            {
                if (!Globals.ValidateCertFile(this.fileBankUnionCert.PostedFile.FileName))
                {
                    this.ShowMsg("非法的证书文件", false);
                    return(null);
                }
                this.fileBankUnionCert.PostedFile.SaveAs(base.Server.MapPath("~/config/") + this.fileBankUnionCert.PostedFile.FileName);
            }
            string text = "";

            if (selectedName.StartsWith("hishop.plugins.payment."))
            {
                text = selectedName.Replace("hishop.plugins.payment.", "");
            }
            if (text.LastIndexOf(".") > 0)
            {
                text = text.Substring(0, text.LastIndexOf("."));
            }
            if (!string.IsNullOrEmpty(text))
            {
                text += "/";
            }
            HttpFileCollection  files = base.Request.Files;
            NameValueCollection nameValueCollection = new NameValueCollection();
            ConfigablePlugin    configablePlugin    = PaymentRequest.CreateInstance(selectedName);

            if (configablePlugin == null)
            {
                return(null);
            }
            if (string.IsNullOrEmpty(selectedName) || selectedName.Length == 0)
            {
                return(null);
            }
            string[] allKeys = base.Request.Form.AllKeys;
            foreach (string text2 in allKeys)
            {
                if (text2 == "SignCertFileName")
                {
                    nameValueCollection.Add(text2, this.fileBankUnionCert.PostedFile.FileName);
                }
                else
                {
                    nameValueCollection.Add(text2, base.Request.Form[text2].Trim());
                }
            }
            IList <string> fileConfigNames = configablePlugin.GetFileConfigNames();

            if (fileConfigNames != null && files.Count >= 2 && files.Count > fileConfigNames.Count)
            {
                string text3 = "/pay/cert/" + text;
                if (!Globals.PathExist(text3, false))
                {
                    Globals.CreatePath(text3);
                }
                for (int j = 1; j < files.Count; j++)
                {
                    if (files[j].ContentLength > 0)
                    {
                        if (Globals.ValidateCertFile(files[j].FileName))
                        {
                            files[j].SaveAs(base.Server.MapPath(text3 + files[j].FileName));
                            nameValueCollection.Add(fileConfigNames[j - 1], text3 + files[j].FileName);
                            continue;
                        }
                        this.ShowMsg("非法的证书文件", false);
                        return(null);
                    }
                    nameValueCollection.Add(fileConfigNames[j - 1], "");
                }
            }
            ConfigData configData = configablePlugin.GetConfigData(nameValueCollection);

            if (configData != null)
            {
                this.txtConfigData.Value = configData.SettingsXml;
            }
            return(configData);
        }
Ejemplo n.º 10
0
        private void BindControl()
        {
            SiteSettings siteSettings = SettingsManager.GetMasterSettings();

            this.txtContactName.Text  = siteSettings.HiPOSContactName;
            this.txtContactPhone.Text = siteSettings.HiPOSContactPhone;
            this.txtSellerName.Text   = siteSettings.HiPOSSellerName;
            this.txtExpireAt.Text     = siteSettings.HiPOSExpireAt;
            PaymentModeInfo         paymentModeInfo = null;
            IList <PaymentModeInfo> paymentModes    = SalesHelper.GetPaymentModes(PayApplicationType.payOnAll);

            (from c in paymentModes
             where c.Gateway.Contains("alipay")
             select c).ForEach(delegate(PaymentModeInfo alipayPayment)
            {
                paymentModeInfo = SalesHelper.GetPaymentMode(alipayPayment.ModeId);
                Globals.EntityCoding(paymentModeInfo, false);
                ConfigablePlugin configablePlugin2 = PaymentRequest.CreateInstance(paymentModeInfo.Gateway.ToLower());
                if (configablePlugin2 == null)
                {
                    base.GotoResourceNotFound();
                }
                else
                {
                    Globals.EntityCoding(paymentModeInfo, false);
                    ConfigData configData2      = new ConfigData(HiCryptographer.Decrypt(paymentModeInfo.Settings));
                    this.configXml              = configData2.SettingsXml;
                    this.txtZFBConfigData.Value = configData2.SettingsXml;
                    string text5 = this.GetNodeValue(this.txtZFBConfigData.Value, "Partner").Trim();
                    if (string.IsNullOrEmpty(this.txtZFBPID.Text))
                    {
                        this.txtZFBPID.Text = text5;
                    }
                }
            });
            (from c in paymentModes
             where c.Gateway.Contains(".wx")
             select c).ForEach(delegate(PaymentModeInfo wxPayment)
            {
                paymentModeInfo = SalesHelper.GetPaymentMode(wxPayment.ModeId);
                Globals.EntityCoding(paymentModeInfo, false);
                ConfigablePlugin configablePlugin = PaymentRequest.CreateInstance(paymentModeInfo.Gateway.ToLower());
                if (configablePlugin == null)
                {
                    base.GotoResourceNotFound();
                }
                else
                {
                    Globals.EntityCoding(paymentModeInfo, false);
                    ConfigData configData      = new ConfigData(HiCryptographer.Decrypt(paymentModeInfo.Settings));
                    this.txtWXConfigData.Value = configData.SettingsXml;
                    string text  = (!string.IsNullOrEmpty(siteSettings.HiPOSWXAppId)) ? siteSettings.HiPOSWXAppId : this.GetNodeValue(this.txtWXConfigData.Value, "AppId").Trim();
                    string text2 = (!string.IsNullOrEmpty(siteSettings.HiPOSWXMchId)) ? siteSettings.HiPOSWXMchId : this.GetNodeValue(this.txtWXConfigData.Value, "MCHID").Trim();
                    string text3 = (!string.IsNullOrEmpty(siteSettings.HiPOSWXCertPath)) ? siteSettings.HiPOSWXCertPath : this.GetNodeValue(this.txtWXConfigData.Value, "CertPath").Trim();
                    if (string.IsNullOrEmpty(this.txtWXAppId.Text))
                    {
                        this.txtWXAppId.Text = text;
                    }
                    if (string.IsNullOrEmpty(this.txtWXMchId.Text))
                    {
                        this.txtWXMchId.Text = text2;
                    }
                    if (string.IsNullOrEmpty(this.hdCertPath.Value) && !string.IsNullOrEmpty(text3))
                    {
                        string text4 = text3.Replace("\\", "/").Replace("//", "/").Replace("/", "\\");
                        if (!File.Exists(text4))
                        {
                            text4 = Globals.PhysicalPath(text3).Replace("\\", "/").Replace("//", "/")
                                    .Replace("/", "\\");
                        }
                        this.hdCertPath.Value = text4 + " 删除重传";
                        this.fuWXCertPath.Style.Add("display", "none");
                    }
                }
            });
            this.ooZFB.SelectedValue = siteSettings.EnableHiPOSZFB;
            this.ooWX.SelectedValue  = siteSettings.EnableHiPOSWX;
            if (siteSettings.EnableHiPOSZFB)
            {
                this.txtZFBPID.Text = siteSettings.HiPOSZFBPID;
            }
            else
            {
                this.ulZFB.Style.Add("display", "none");
            }
            if (siteSettings.EnableHiPOSWX)
            {
                this.txtWXAppId.Text  = siteSettings.HiPOSWXAppId;
                this.txtWXMchId.Text  = siteSettings.HiPOSWXMchId;
                this.txtWXAPIKey.Text = siteSettings.HiPOSWXAPIKey;
            }
            else
            {
                this.ulWX.Style.Add("display", "none");
            }
            if (string.IsNullOrEmpty(this.txtZFBKey.Text.Trim()))
            {
                this.txtZFBKey.Text = this.CreatePubKeyContent();
            }
        }