Example #1
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["modeId"], out this.modeId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
         if (!this.Page.IsPostBack)
         {
             PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(this.modeId);
             if (paymentMode == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 Globals.EntityCoding(paymentMode, false);
                 this.txtSelectedName.Value = paymentMode.Gateway.ToLower();
                 ConfigData data = new ConfigData(HiCryptographer.Decrypt(paymentMode.Settings));
                 this.txtConfigData.Value                  = data.SettingsXml;
                 this.txtName.Text                         = paymentMode.Name;
                 this.fcContent.Text                       = paymentMode.Description;
                 this.txtCharge.Text                       = paymentMode.Charge.ToString("F", System.Globalization.CultureInfo.InvariantCulture);
                 this.chkIsPercent.Checked                 = paymentMode.IsPercent;
                 this.radiIsUseInpour.SelectedValue        = paymentMode.IsUseInpour;
                 this.radiIsUseInDistributor.SelectedValue = paymentMode.IsUseInDistributor;
             }
         }
     }
 }
Example #2
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
     if (!base.IsPostBack)
     {
         SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
         this.radEnableWapShengPay.SelectedValue = masterSettings.EnableWapShengPay;
         PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode("Hishop.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest");
         if (paymentMode != null)
         {
             string      xml      = HiCryptographer.Decrypt(paymentMode.Settings);
             XmlDocument document = new XmlDocument();
             document.LoadXml(xml);
             try
             {
                 this.txtPartner.Text = document.GetElementsByTagName("SenderId")[0].InnerText;
                 this.txtKey.Text     = document.GetElementsByTagName("SellerKey")[0].InnerText;
             }
             catch
             {
                 this.txtPartner.Text = "";
                 this.txtKey.Text     = "";
             }
         }
         PaymentModeInfo info2 = SalesHelper.GetPaymentMode("Hishop.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest");
         if (info2 != null)
         {
             string str2 = HiCryptographer.Decrypt(info2.Settings);
             new XmlDocument().LoadXml(str2);
         }
     }
 }
Example #3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            System.Collections.Specialized.NameValueCollection parameters = new System.Collections.Specialized.NameValueCollection
            {
                this.Page.Request.Form,
                this.Page.Request.QueryString
            };
            this.Gateway = "Ecdev.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest";
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, parameters);
            this.OrderId = this.Notify.GetOrderId();
            this.Order   = ShoppingProcessor.GetOrderInfo(this.OrderId);
            if (this.Order == null)
            {
                base.Response.Write("<p style=\"font-size:16px;\">找不到对应的订单,你付款的订单可能已经被删除</p>");
                return;
            }
            this.Amount = this.Notify.GetOrderAmount();
            if (this.Amount <= 0m)
            {
                this.Amount = this.Order.GetTotal();
            }
            this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();
            PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode("Ecdev.Plugins.Payment.ShengPayMobile.ShengPayMobileRequest");

            if (paymentMode == null)
            {
                base.Response.Write("<p style=\"font-size:16px;\">找不到对应的支付方式,该支付方式可能已经被删除</p>");
                return;
            }
            this.Notify.Finished          += new System.EventHandler <FinishedEventArgs>(this.Notify_Finished);
            this.Notify.NotifyVerifyFaild += new System.EventHandler(this.Notify_NotifyVerifyFaild);
            this.Notify.Payment           += new System.EventHandler(this.Notify_Payment);
            this.Notify.VerifyNotify(30000, HiCryptographer.Decrypt(paymentMode.Settings));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.openIdType = this.GetParameter("HIGW");
            if (!string.IsNullOrEmpty(this.openIdType))
            {
                this.openIdType = this.openIdType.ToLower().Replace("_", ".");
            }
            OpenIdSettingInfo openIdSettings = MemberProcessor.GetOpenIdSettings(this.openIdType);

            if (openIdSettings == null)
            {
                base.Response.Write("登录失败,没有找到对应的插件配置信息。");
            }
            else
            {
                this.parameters = new NameValueCollection
                {
                    this.Page.Request.Form,
                    this.Page.Request.QueryString
                };
                OpenIdNotify openIdNotify = OpenIdNotify.CreateInstance(this.openIdType, this.parameters);
                openIdNotify.Authenticated += this.Notify_Authenticated;
                openIdNotify.Failed        += this.Notify_Failed;
                try
                {
                    openIdNotify.Verify(30000, HiCryptographer.Decrypt(openIdSettings.Settings));
                }
                catch
                {
                    this.Page.Response.Redirect("/");
                }
            }
        }
        private void HaiMeiSendMessage(SiteSettings settings, string cellphone)
        {
            try
            {
                string     text       = HiContext.Current.GenerateRandomNumber(4);
                ConfigData configData = new ConfigData(HiCryptographer.Decrypt(settings.SMSSettings));
                SMSSender  sMSSender  = SMSSender.CreateInstance(settings.SMSSender, configData.SettingsXml);
                string     text2      = string.Format(@"您好!您正在进行海美生活会员修改密码,本次的验证码为:{0},请勿向任何人提供您收到的短信验证码,并尽快完成验证。", text);
                string     text3;

                bool flag = sMSSender.Send(cellphone, text2, out text3);
                if (flag)
                {
                    //HiCache.Insert(HiContext.Current.User.UserId + "cellphone", text, 10800);
                    EcShop.Entities.Members.Verify verfyinfo = new Entities.Members.Verify();
                    verfyinfo.VerifyCode = text;
                    verfyinfo.CellPhone  = cellphone.Trim();
                    EcShop.ControlPanel.Members.TelVerifyHelper.CreateVerify(verfyinfo);
                }
                this.message = "{\"success\":true,\"msg\":\"" + text3 + "\"}";
            }
            catch (System.Exception)
            {
                this.message = "{\"success\":false,\"msg\":\"未知错误\"}";
            }
        }
Example #6
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
         this.radEnableWapAliPay.SelectedValue = masterSettings.EnableAliOHAliPay;
         PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode("Ecdev.plugins.payment.ws_wappay.wswappayrequest");
         if (paymentMode != null)
         {
             string xml = HiCryptographer.Decrypt(paymentMode.Settings);
             System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();
             xmlDocument.LoadXml(xml);
             this.txtPartner.Text = xmlDocument.GetElementsByTagName("Partner")[0].InnerText;
             this.txtKey.Text     = xmlDocument.GetElementsByTagName("Key")[0].InnerText;
             this.txtAccount.Text = xmlDocument.GetElementsByTagName("Seller_account_name")[0].InnerText;
         }
         PaymentModeInfo paymentMode2 = SalesHelper.GetPaymentMode("Ecdev.plugins.payment.ws_apppay.wswappayrequest");
         if (paymentMode2 != null)
         {
             string xml2 = HiCryptographer.Decrypt(paymentMode2.Settings);
             System.Xml.XmlDocument xmlDocument2 = new System.Xml.XmlDocument();
             xmlDocument2.LoadXml(xml2);
         }
     }
 }
Example #7
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            this.openIdType = base.Request.QueryString["t"];
            if (string.IsNullOrEmpty(this.openIdType) || this.openIdType.Trim().Length == 0)
            {
                base.GotoResourceNotFound();
            }
            PluginItem pluginItem = OpenIdPlugins.Instance().GetPluginItem(this.openIdType);

            if (pluginItem == null)
            {
                base.GotoResourceNotFound();
            }
            if (!this.Page.IsPostBack)
            {
                this.txtName.Text          = pluginItem.DisplayName;
                this.lblDisplayName.Text   = pluginItem.DisplayName;
                this.lblDisplayName2.Text  = pluginItem.DisplayName;
                this.txtSelectedName.Value = this.openIdType;
                OpenIdSettingsInfo openIdSettings = OpenIdHelper.GetOpenIdSettings(this.openIdType);
                if (openIdSettings != null)
                {
                    ConfigData configData = new ConfigData(HiCryptographer.Decrypt(openIdSettings.Settings));
                    this.txtConfigData.Value = configData.SettingsXml;
                    this.txtName.Text        = openIdSettings.Name;
                    this.fcContent.Text      = openIdSettings.Description;
                }
            }
        }
Example #8
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string             openIdType     = "Ecdev.plugins.openid.alipay.alipayservice";
            OpenIdSettingsInfo openIdSettings = OpenIdHelper.GetOpenIdSettings(openIdType);

            if (openIdSettings == null)
            {
                return;
            }
            string value = base.Request.QueryString["alipaytoken"];

            System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();
            xmlDocument.LoadXml(HiCryptographer.Decrypt(openIdSettings.Settings));
            System.Collections.Generic.SortedDictionary <string, string> sortedDictionary = new System.Collections.Generic.SortedDictionary <string, string>();
            sortedDictionary.Add("service", "user.logistics.address.query");
            sortedDictionary.Add("partner", xmlDocument.FirstChild.SelectSingleNode("Partner").InnerText);
            sortedDictionary.Add("_input_charset", "utf-8");
            sortedDictionary.Add("return_url", Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("LogisticsAddress_url")));
            sortedDictionary.Add("token", value);
            System.Collections.Generic.Dictionary <string, string> dictionary = OpenIdFunction.FilterPara(sortedDictionary);
            string value2 = OpenIdFunction.BuildMysign(dictionary, xmlDocument.FirstChild.SelectSingleNode("Key").InnerText, "MD5", "utf-8");

            dictionary.Add("sign", value2);
            dictionary.Add("sign_type", "MD5");
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            foreach (System.Collections.Generic.KeyValuePair <string, string> current in dictionary)
            {
                stringBuilder.Append(OpenIdFunction.CreateField(current.Key, current.Value));
            }
            sortedDictionary.Clear();
            dictionary.Clear();
            OpenIdFunction.Submit(OpenIdFunction.CreateForm(stringBuilder.ToString(), "https://mapi.alipay.com/gateway.do?_input_charset=utf-8"));
        }
Example #9
0
        private void btnConfirm_Click(object sender, System.EventArgs e)
        {
            PaymentModeInfo   paymentMode       = TradeHelper.GetPaymentMode(this.paymentModeId);
            InpourRequestInfo inpourRequestInfo = new InpourRequestInfo
            {
                InpourId     = this.GenerateInpourId(),
                TradeDate    = System.DateTime.Now,
                InpourBlance = this.balance,
                UserId       = HiContext.Current.User.UserId,
                PaymentId    = paymentMode.ModeId
            };

            if (MemberProcessor.AddInpourBlance(inpourRequestInfo))
            {
                string attach = "";
                System.Web.HttpCookie httpCookie = HiContext.Current.Context.Request.Cookies["Token_" + HiContext.Current.User.UserId.ToString()];
                if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
                {
                    attach = httpCookie.Value;
                }
                string         orderId        = inpourRequestInfo.InpourId.ToString(System.Globalization.CultureInfo.InvariantCulture);
                string         configXml      = HiCryptographer.Decrypt(paymentMode.Settings);
                decimal        amount         = inpourRequestInfo.InpourBlance + (decimal)this.ViewState["PayCharge"];
                PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, configXml, orderId, amount, "预付款充值", "操作流水号-" + orderId, HiContext.Current.User.Email, inpourRequestInfo.TradeDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("InpourReturn_url", new object[]
                {
                    paymentMode.Gateway
                })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("InpourNotify_url", new object[]
                {
                    paymentMode.Gateway
                })), attach);
            }
        }
Example #10
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (this.Context.Request.IsAuthenticated)
            {
                System.Web.Security.FormsAuthentication.SignOut();
                System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(Hidistro.Membership.Context.HiContext.Current.User.Username, true);
                Hidistro.Membership.Core.IUserCookie userCookie = Hidistro.Membership.Context.HiContext.Current.User.GetUserCookie();
                if (userCookie != null)
                {
                    userCookie.DeleteCookie(authCookie);
                }
                Hidistro.Membership.Core.RoleHelper.SignOut(Hidistro.Membership.Context.HiContext.Current.User.Username);
            }
            string text = base.Request.QueryString["ot"];

            if (OpenIdPlugins.Instance().GetPluginItem(text) == null)
            {
                this.lblMsg.Text = "没有找到对应的插件,<a href=\"" + Globals.GetSiteUrls().Home + "\">返回首页</a>。";
                return;
            }
            OpenIdSettingsInfo openIdSettings = MemberProcessor.GetOpenIdSettings(text);

            if (openIdSettings == null)
            {
                this.lblMsg.Text = "请先配置此插件所需的信息,<a href=\"" + Globals.GetSiteUrls().Home + "\">返回首页</a>。";
                return;
            }
            string returnUrl = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("OpenIdEntry_url", new object[]
            {
                text
            }));
            OpenIdService openIdService = OpenIdService.CreateInstance(text, HiCryptographer.Decrypt(openIdSettings.Settings), returnUrl);

            openIdService.Post();
        }
Example #11
0
 protected override string AuthenticateToken(UsernameToken token)
 {
     Hidistro.Membership.Core.Enums.LoginUserStatus loginUserStatus;
     try
     {
         Hidistro.Membership.Context.SiteManager siteManager = Hidistro.Membership.Context.Users.GetUser(0, token.Identity.Name, false, false) as Hidistro.Membership.Context.SiteManager;
         if (siteManager != null && siteManager.IsAdministrator)
         {
             Hidistro.Membership.Context.HiContext arg_29_0 = Hidistro.Membership.Context.HiContext.Current;
             siteManager.Password = HiCryptographer.Decrypt(token.Password);
             loginUserStatus      = Hidistro.Membership.Context.Users.ValidateUser(siteManager);
         }
         else
         {
             loginUserStatus = Hidistro.Membership.Core.Enums.LoginUserStatus.InvalidCredentials;
         }
     }
     catch
     {
         loginUserStatus = Hidistro.Membership.Core.Enums.LoginUserStatus.InvalidCredentials;
     }
     if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.Success)
     {
         return(token.Password);
     }
     return(HiCryptographer.CreateHash(token.Password));
 }
 private void BindRealName(OrderInfo order)
 {
     this.hidCertificationModel.Value = HiContext.Current.SiteSettings.CertificationModel.ToString();
     this.lblShipTo.Text   = order.ShipTo;
     this.lblRealName.Text = order.ShipTo;
     this.lblIDNumber.Text = HiCryptographer.Decrypt(order.IDNumber);
     this.txtIDRemark.Text = order.IDRemark;
     if (!string.IsNullOrWhiteSpace(order.IDImage1))
     {
         this.IDImageJust.Src     = order.IDImage1;
         this.IDImageJust.Visible = true;
     }
     else
     {
         this.IDImageJust.Visible = false;
     }
     if (!string.IsNullOrWhiteSpace(order.IDImage2))
     {
         this.IDImageAnti.Src     = order.IDImage2;
         this.IDImageAnti.Visible = true;
     }
     else
     {
         this.IDImageAnti.Visible = false;
     }
     if (order.IDStatus == 1)
     {
         this.btnPass.Visible = false;
     }
 }
Example #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string     text       = base.Request.QueryString["ot"];
            PluginItem pluginItem = OpenIdPlugins.Instance().GetPluginItem(text);
            string     text2      = "WapShop";

            if (string.IsNullOrEmpty(this.Page.Request.RawUrl))
            {
                goto IL_0049;
            }
            goto IL_0049;
IL_0049:
            if (pluginItem == null)
            {
                this.lblMsg.Text = "没有找到对应的插件,<a href=\"/\">返回首页</a>。";
            }
            else
            {
                OpenIdSettingInfo openIdSettings = MemberProcessor.GetOpenIdSettings(text);
                if (openIdSettings == null)
                {
                    this.lblMsg.Text = "请先配置此插件所需的信息,<a href=\"/\">返回首页</a>。";
                }
                else
                {
                    string returnUrl = Globals.FullPath(base.GetRouteUrl("OpenIdEntry_url", new
                    {
                        HIGW = text.Replace(".", "_")
                    }));
                    OpenIdService openIdService = OpenIdService.CreateInstance(text, HiCryptographer.Decrypt(openIdSettings.Settings), returnUrl);
                    openIdService.Post();
                }
            }
        }
Example #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string     text       = base.Request.QueryString["ot"];
            PluginItem pluginItem = OpenIdPlugins.Instance().GetPluginItem(text);

            if (pluginItem == null)
            {
                this.msg = "没有找到对应的插件,<a href=\"/\">返回首页</a>。";
            }
            else
            {
                OpenIdSettingInfo openIdSettings = MemberProcessor.GetOpenIdSettings(text);
                if (openIdSettings == null)
                {
                    this.msg = "请先配置此插件所需的信息,<a href=\"/\">返回首页</a>。";
                }
                else
                {
                    string text2 = base.Request.QueryString["returnUrl"];
                    string text3 = base.Request.QueryString["client"].ToNullString();
                    if (string.IsNullOrEmpty(text3))
                    {
                        text3 = "wapshop";
                    }
                    string returnUrl = Globals.FullPath(base.GetRouteUrl("OpenIdEntry_url_Wap", new
                    {
                        HIGW = text.Replace(".", "_")
                    })).ToLower().Replace("/wapshop/", "/" + text3 + "/");
                    OpenIdService openIdService = OpenIdService.CreateInstance(text, HiCryptographer.Decrypt(openIdSettings.Settings), returnUrl);
                    openIdService.Post();
                }
            }
        }
Example #15
0
        protected string GetAmount(SiteSettings settings)
        {
            string result;

            if (string.IsNullOrEmpty(settings.SMSSettings))
            {
                result = "";
            }
            else
            {
                string      xml      = HiCryptographer.Decrypt(settings.SMSSettings);
                XmlDocument document = new XmlDocument();
                document.LoadXml(xml);
                string innerText = document.SelectSingleNode("xml/Appkey").InnerText;
                string postData  = "method=getAmount&Appkey=" + innerText;
                string s         = this.PostData("http://sms.kuaidiantong.cn/getAmount.aspx", postData);
                int    num;
                if (int.TryParse(s, out num))
                {
                    result = "您的短信剩余条数为:" + s.ToString();
                }
                else
                {
                    result = "获取短信条数发生错误,请检查Appkey是否输入正确!";
                }
            }
            return(result);
        }
Example #16
0
        public static bool IsHavePermission(RolePermissionInfo model)
        {
            string text = HiCache.Get(string.Format("DataCache-RolePermissions-{0}", model.RoleId)) as string;
            List <RolePermissionInfo> list = new List <RolePermissionInfo>();

            if (!string.IsNullOrEmpty(text))
            {
                string value = HiCryptographer.Decrypt(text);
                list = JsonConvert.DeserializeObject <List <RolePermissionInfo> >(value);
            }
            if (list == null || list.Count == 0)
            {
                list = new RolePermissionDao().GetPermissionsByRoleId(model.RoleId);
                string obj = HiCryptographer.Encrypt(JsonConvert.SerializeObject(list));
                HiCache.Insert(string.Format("DataCache-RolePermissions-{0}", model.RoleId), obj, 360, CacheItemPriority.Normal);
            }
            bool result;

            if (list == null || list.Count == 0)
            {
                result = false;
            }
            else
            {
                RolePermissionInfo rolePermissionInfo = list.FirstOrDefault((RolePermissionInfo p) => p.PermissionId == model.PermissionId);
                result = (rolePermissionInfo != null);
            }
            return(result);
        }
Example #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Context.Request.IsAuthenticated)
            {
                FormsAuthentication.SignOut();
                HttpCookie  authCookie = FormsAuthentication.GetAuthCookie(HiContext.Current.User.Username, true);
                IUserCookie userCookie = HiContext.Current.User.GetUserCookie();
                if (userCookie != null)
                {
                    userCookie.DeleteCookie(authCookie);
                }
                RoleHelper.SignOut(HiContext.Current.User.Username);
            }
            string fullName = base.Request.QueryString["ot"];

            if (OpenIdPlugins.Instance().GetPluginItem(fullName) == null)
            {
                this.lblMsg.Text = "没有找到对应的插件,<a href=\"" + Globals.GetSiteUrls().Home + "\">返回首页</a>。";
            }
            else
            {
                OpenIdSettingsInfo openIdSettings = MemberProcessor.GetOpenIdSettings(fullName);
                if (openIdSettings == null)
                {
                    this.lblMsg.Text = "请先配置此插件所需的信息,<a href=\"" + Globals.GetSiteUrls().Home + "\">返回首页</a>。";
                }
                else
                {
                    string returnUrl = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("OpenIdEntry_url", new object[] { fullName }));
                    OpenIdService.CreateInstance(fullName, HiCryptographer.Decrypt(openIdSettings.Settings), returnUrl).Post();
                }
            }
        }
 private void SendEmail(SiteSettings settings, string email)
 {
     try
     {
         string     text       = HiContext.Current.CreateVerifyCode(4);
         ConfigData configData = new ConfigData(HiCryptographer.Decrypt(settings.EmailSettings));
         string     body       = string.Format("尊敬的会员{0}您好:欢迎使用" + settings.SiteName + "系统,此次验证码为:{1},请在3分钟内完成验证", HiContext.Current.User.Username, text);
         System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage
         {
             IsBodyHtml      = true,
             Priority        = System.Net.Mail.MailPriority.High,
             SubjectEncoding = System.Text.Encoding.UTF8,
             BodyEncoding    = System.Text.Encoding.UTF8,
             Body            = body,
             Subject         = "来自" + settings.SiteName
         };
         mailMessage.To.Add(email);
         EmailSender emailSender = EmailSender.CreateInstance(settings.EmailSender, configData.SettingsXml);
         if (emailSender.Send(mailMessage, System.Text.Encoding.GetEncoding(HiConfiguration.GetConfig().EmailEncoding)))
         {
             this.message = "{\"success\":true,\"msg\":\"发送邮件成功,请查收\"}";
             HiCache.Insert(email + "email", text, 10800);
         }
         else
         {
             this.message = "{\"success\":false,\"msg\":\"发送邮件失败,请检查邮箱账号是否存在\"}";
         }
     }
     catch (System.Exception)
     {
         this.message = "{\"success\":false,\"msg\":\"发送失败,请检查邮箱账号是否存在\"}";
     }
 }
Example #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string             openIdType     = "hishop.plugins.openid.alipay.alipayservice";
            OpenIdSettingsInfo openIdSettings = OpenIdHelper.GetOpenIdSettings(openIdType);

            if (openIdSettings != null)
            {
                string      str2     = base.Request.QueryString["alipaytoken"];
                XmlDocument document = new XmlDocument();
                document.LoadXml(HiCryptographer.Decrypt(openIdSettings.Settings));
                SortedDictionary <string, string> dicArrayPre = new SortedDictionary <string, string>();
                dicArrayPre.Add("service", "user.logistics.address.query");
                dicArrayPre.Add("partner", document.FirstChild.SelectSingleNode("Partner").InnerText);
                dicArrayPre.Add("_input_charset", "utf-8");
                dicArrayPre.Add("return_url", Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("LogisticsAddress_url")));
                dicArrayPre.Add("token", str2);
                Dictionary <string, string> dicArray = OpenIdFunction.FilterPara(dicArrayPre);
                string str3 = OpenIdFunction.BuildMysign(dicArray, document.FirstChild.SelectSingleNode("Key").InnerText, "MD5", "utf-8");
                dicArray.Add("sign", str3);
                dicArray.Add("sign_type", "MD5");
                StringBuilder builder = new StringBuilder();
                foreach (KeyValuePair <string, string> pair in dicArray)
                {
                    builder.Append(OpenIdFunction.CreateField(pair.Key, pair.Value));
                }
                dicArrayPre.Clear();
                dicArray.Clear();
                OpenIdFunction.Submit(OpenIdFunction.CreateForm(builder.ToString(), "https://mapi.alipay.com/gateway.do?_input_charset=utf-8"));
            }
        }
Example #20
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                if (masterSettings.SMSEnabled)
                {
                    ConfigData configData = new ConfigData(HiCryptographer.Decrypt(masterSettings.SMSSettings));
                    this.txtConfigData.Value = configData.SettingsXml;
                }
                //this.lbNum.Text = this.GetAmount(masterSettings);
                this.txtSelectedName.Value = "Ecdev.plugins.sms.ymsms";


                var member = HiContext.Current.User;
                if (member != null && !member.IsLockedOut)
                {
                    if (member.Username != "admin")
                    {
                        sendtype.Visible = false;
                    }
                }
                //if()
            }
        }
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("余额充值");
            this.litPaymentType = (Literal)this.FindControl("litPaymentType");
            IList <PaymentModeInfo> paymentModes   = ShoppingProcessor.GetPaymentModes();
            SiteSettings            masterSettings = SettingsManager.GetMasterSettings(true);
            StringBuilder           builder        = new StringBuilder();
            string userAgent = this.Page.Request.UserAgent;

            if ((masterSettings.EnableWeiXinRequest && userAgent.ToLower().Contains("micromessenger")) && masterSettings.IsValidationService)
            {
                builder.AppendLine("<div class=\"payway\" name=\"88\">微信支付</div>");
            }
            if ((paymentModes != null) && (paymentModes.Count > 0))
            {
                foreach (PaymentModeInfo info in paymentModes)
                {
                    string      xml      = HiCryptographer.Decrypt(info.Settings);
                    XmlDocument document = new XmlDocument();
                    document.LoadXml(xml);
                    if (document.GetElementsByTagName("Partner").Count != 0)
                    {
                        if ((masterSettings.EnableAlipayRequest && !string.IsNullOrEmpty(document.GetElementsByTagName("Partner")[0].InnerText)) && (!string.IsNullOrEmpty(document.GetElementsByTagName("Key")[0].InnerText) && !string.IsNullOrEmpty(document.GetElementsByTagName("Seller_account_name")[0].InnerText)))
                        {
                            builder.AppendFormat("<div class=\"payway\" name=\"{0}\">{1}</div>", info.ModeId, info.Name).AppendLine();
                        }
                    }
                    else if ((masterSettings.EnableWapShengPay && !string.IsNullOrEmpty(document.GetElementsByTagName("SenderId")[0].InnerText)) && !string.IsNullOrEmpty(document.GetElementsByTagName("SellerKey")[0].InnerText))
                    {
                        builder.AppendFormat("<div class=\"payway\" name=\"{0}\">{1}</div>", info.ModeId, info.Name).AppendLine();
                    }
                }
            }
            this.litPaymentType.Text = builder.ToString();
        }
Example #22
0
        protected override string AuthenticateToken(UsernameToken token)
        {
            LoginUserStatus invalidCredentials;

            try
            {
                SiteManager user = Users.GetUser(0, token.Identity.Name, false, false) as SiteManager;
                if ((user != null) && user.IsAdministrator)
                {
                    HiContext current = HiContext.Current;
                    user.Password      = HiCryptographer.Decrypt(token.Password);
                    invalidCredentials = Users.ValidateUser(user);
                }
                else
                {
                    invalidCredentials = LoginUserStatus.InvalidCredentials;
                }
            }
            catch
            {
                invalidCredentials = LoginUserStatus.InvalidCredentials;
            }
            if (invalidCredentials == LoginUserStatus.Success)
            {
                return(token.Password);
            }
            return(HiCryptographer.CreateHash(token.Password));
        }
Example #23
0
        protected override void AttachChildControls()
        {
            string payId = this.Page.Request.QueryString["PayId"];
            MemberAmountDetailedInfo amountDetailByPayId = MemberAmountProcessor.GetAmountDetailByPayId(payId);

            if (amountDetailByPayId == null)
            {
                this.Page.Response.Redirect("/Vshop/MemberRecharge.aspx");
            }
            this.Page.Request.Url.ToString().ToLower();
            int    num       = Globals.RequestQueryNum("IsAlipay");
            string userAgent = this.Page.Request.UserAgent;

            if (((num != 1) && userAgent.ToLower().Contains("micromessenger")) && (amountDetailByPayId.TradeWays == TradeWays.Alipay))
            {
                this.Page.Response.Redirect("/Pay/IframeAlipayCharge.aspx?PayId=" + payId);
            }
            else if (amountDetailByPayId.TradeWays == TradeWays.WeChatWallet)
            {
                this.Page.Response.Redirect("~/pay/wx_SubmitCharge.aspx?PayId=" + payId);
            }
            else if ((amountDetailByPayId.TradeWays != TradeWays.WeChatWallet) && (amountDetailByPayId.TradeWays != TradeWays.LineTransfer))
            {
                PaymentModeInfo paymentMode = MemberAmountProcessor.GetPaymentMode(amountDetailByPayId.TradeWays);
                string          attach      = "";
                string          showUrl     = string.Format("http://{0}/vshop/", HttpContext.Current.Request.Url.Host);
                PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), payId, amountDetailByPayId.TradeAmount, "会员充值", "充值号-" + payId, "", amountDetailByPayId.TradeTime, showUrl, Globals.FullPath("/pay/RePaymentReturn_url.aspx"), Globals.FullPath("/pay/RePaymentNotify_url.aspx"), attach).SendRequest();
            }
        }
        private void DoValidate()
        {
            System.Collections.Specialized.NameValueCollection nameValueCollection = new System.Collections.Specialized.NameValueCollection
            {
                this.Page.Request.Form,
                this.Page.Request.QueryString
            };
            if (!this.isBackRequest)
            {
                nameValueCollection.Add("IsReturn", "true");
            }
            this.Gateway = "hishop.plugins.payment.ws_wappay.wswappayrequest";
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, nameValueCollection);
            if (this.isBackRequest)
            {
                this.Notify.ReturnUrl = Globals.FullPath("/pay/PaymentReturn_url.aspx") + "?" + this.Page.Request.Url.Query;
            }
            this.OrderId = this.Notify.GetOrderId();
            string gatewayOrderId = this.Notify.GetGatewayOrderId();

            if (string.IsNullOrEmpty(this.OrderId))
            {
                Globals.Debuglog(" OrderId:没获取到,GetewayOrderId:" + gatewayOrderId, "_DebuglogPaymentTest.txt");
                this.ResponseStatus(true, "noorderId");
            }
            else
            {
                this.orderlist = ShoppingProcessor.GetOrderMarkingOrderInfo(this.OrderId, false);
                if (this.orderlist.Count == 0)
                {
                    Globals.Debuglog("更新订单失败,也许是订单已后台付款,OrderId:" + this.OrderId, "_DebugAlipayPayNotify.txt");
                    this.ResponseStatus(true, "nodata");
                }
                else
                {
                    int modeId = 0;
                    foreach (OrderInfo current in this.orderlist)
                    {
                        this.Amount           += current.GetTotal();
                        current.GatewayOrderId = gatewayOrderId;
                        modeId = current.PaymentTypeId;
                    }
                    PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode(modeId);
                    if (paymentMode == null)
                    {
                        Globals.Debuglog("gatewaynotfound" + this.OrderId, "_DebugAlipayPayNotify.txt");
                        this.ResponseStatus(true, "gatewaynotfound");
                    }
                    else
                    {
                        this.Notify.Finished          += new System.EventHandler <FinishedEventArgs>(this.Notify_Finished);
                        this.Notify.NotifyVerifyFaild += new System.EventHandler(this.Notify_NotifyVerifyFaild);
                        this.Notify.Payment           += new System.EventHandler(this.Notify_Payment);
                        string configXml = HiCryptographer.Decrypt(paymentMode.Settings);
                        this.Notify.VerifyNotify(30000, configXml);
                    }
                }
            }
        }
        protected override void Render(HtmlTextWriter writer)
        {
            IList <PaymentModeInfo> paymentModes = ShoppingProcessor.GetPaymentModes();
            StringBuilder           builder      = new StringBuilder();

            if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.IsProLa)
            {
                builder.Append("<button  class=\"choose\" data-toggle=\"dropdown\">请选择一种支付方式<span class=\"caret\"></span></button>");
            }
            else
            {
                builder.Append("<button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\">请选择一种支付方式<span class=\"caret\"></span></button>");
            }

            builder.AppendLine("<ul id=\"selectPaymentType\" class=\"dropdown-menu\" role=\"menu\">");
            if (MemberProcessor.GetCurrentMember().RegSource == 0)
            {
                if (SettingsManager.GetMasterSettings(false).EnableWeiXinRequest)
                {
                    builder.AppendLine("<li><a href=\"#\" name=\"88\">微信支付</a></li>");
                }

                if (SettingsManager.GetMasterSettings(false).EnableOffLineRequest)
                {
                    builder.AppendLine("<li><a href=\"#\" name=\"99\">线下付款</a></li>");
                }
                if (SettingsManager.GetMasterSettings(false).EnablePodRequest)
                {
                    builder.AppendLine("<li><a href=\"#\" name=\"0\">货到付款</a></li>");
                }
                if ((paymentModes != null) && (paymentModes.Count > 0))
                {
                    foreach (PaymentModeInfo info in paymentModes)
                    {
                        string      xml      = HiCryptographer.Decrypt(info.Settings);
                        XmlDocument document = new XmlDocument();
                        document.LoadXml(xml);
                        if (document.GetElementsByTagName("Partner").Count != 0)
                        {
                            if ((!string.IsNullOrEmpty(document.GetElementsByTagName("Partner")[0].InnerText) && !string.IsNullOrEmpty(document.GetElementsByTagName("Key")[0].InnerText)))// && !string.IsNullOrEmpty(document.GetElementsByTagName("Seller_account_name")[0].InnerText)
                            {
                                builder.AppendFormat("<li><a href=\"#\" name=\"{0}\">{1}</a></li>", info.ModeId, info.Name).AppendLine();
                            }
                        }
                        else if ((SettingsManager.GetMasterSettings(false).EnableWapShengPay&& !string.IsNullOrEmpty(document.GetElementsByTagName("SenderId")[0].InnerText)) && !string.IsNullOrEmpty(document.GetElementsByTagName("SellerKey")[0].InnerText))
                        {
                            builder.AppendFormat("<li><a href=\"#\" name=\"{0}\">{1}</a></li>", info.ModeId, info.Name).AppendLine();
                        }
                    }
                }
                builder.AppendLine("</ul>");
                writer.Write(builder.ToString());
            }
            else
            {
                builder.AppendLine("</ul>");
                writer.Write(builder.ToString());
            }
        }
Example #26
0
 private bool CheckVerifyCode(string verifyCode)
 {
     if (HttpContext.Current.Request.Cookies[this.verifyCodeKey] == null)
     {
         return(false);
     }
     return(string.Compare(HiCryptographer.Decrypt(HttpContext.Current.Request.Cookies[this.verifyCodeKey].Value), verifyCode, true, CultureInfo.InvariantCulture) == 0);
 }
        private void DoValidate()
        {
            NameValueCollection nameValueCollection = new NameValueCollection
            {
                this.Page.Request.Form,
                this.Page.Request.QueryString
            };

            this.Gateway = base.GetParameter("HIGW", false);
            this.Gateway = this.Gateway.Replace("_", ".");
            if (this.Gateway == "hishop.plugins.payment.wxqrcode.wxqrcoderequest")
            {
                string wXQRCodePayResult = this.GetWXQRCodePayResult();
                nameValueCollection.Add("notify_data", wXQRCodePayResult);
            }
            this.Notify = PaymentNotify.CreateInstance(this.Gateway, nameValueCollection);
            if (this.Notify == null)
            {
                Globals.AppendLog(nameValueCollection, "通知对象获取失败" + this.Amount, this.Page.Request.Url.ToString(), "", "WapInpourPage");
                this.ResponseStatus(true, "verifyfaild");
            }
            else
            {
                if (this.isBackRequest)
                {
                    string hIGW = this.Gateway.Replace(".", "_");
                    this.Notify.ReturnUrl = Globals.FullPath(base.GetRouteUrl("InpourReturn_url", new
                    {
                        HIGW = hIGW
                    })) + "?" + this.Page.Request.Url.Query;
                }
                this.InpourId      = this.Notify.GetOrderId();
                this.Amount        = this.Notify.GetOrderAmount();
                this.InpourRequest = MemberProcessor.GetInpourBlance(this.InpourId);
                if (this.InpourRequest == null)
                {
                    Globals.AppendLog(nameValueCollection, "未找到相应的充值记录---Amount:" + this.Amount, this.Page.Request.Url.ToString(), "", "WapInpourPage");
                    this.ResponseStatus(true, "success");
                }
                else
                {
                    this.Amount  = this.InpourRequest.InpourBlance;
                    this.paymode = TradeHelper.GetPaymentMode(this.InpourRequest.PaymentId);
                    if (this.paymode == null)
                    {
                        Globals.AppendLog(nameValueCollection, "未获取到支付方式信息", this.Page.Request.Url.ToString(), "", "WapInpourPage");
                        this.ResponseStatus(true, "gatewaynotfound");
                    }
                    else
                    {
                        this.Notify.Finished          += this.Notify_Finished;
                        this.Notify.NotifyVerifyFaild += this.Notify_NotifyVerifyFaild;
                        this.Notify.Payment           += this.Notify_Payment;
                        this.Notify.VerifyNotify(600000, HiCryptographer.Decrypt(this.paymode.Settings));
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            NameValueCollection nameValueCollection = new NameValueCollection
            {
                this.Page.Request.Form
            };

            this.Gateway = "hishop.plugins.payment.ws_wappay.wswappayrequest";
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, nameValueCollection);
            this.OrderId = this.Notify.GetOrderId();
            this.Order   = ShoppingProcessor.GetOrderInfo(this.OrderId);
            if (this.Order == null)
            {
                Globals.WriteLog(nameValueCollection, "订单信息不存在", "", "", "alipay");
                base.Response.Write("success");
            }
            else
            {
                this.Amount = this.Notify.GetOrderAmount();
                if (this.Amount <= decimal.Zero)
                {
                    this.Amount = this.Order.GetTotal(false);
                }
                this.hasNotify = !string.IsNullOrEmpty(this.Order.GatewayOrderId);
                if (this.Order.PreSaleId > 0 && this.Order.DepositGatewayOrderId.ToNullString() == this.Notify.GetGatewayOrderId())
                {
                    base.Response.Write("success");
                }
                else
                {
                    if (this.Order.PreSaleId > 0 && !this.Order.DepositDate.HasValue)
                    {
                        this.Order.DepositGatewayOrderId = this.Notify.GetGatewayOrderId();
                    }
                    else
                    {
                        this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();
                    }
                    PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode("hishop.plugins.payment.ws_wappay.wswappayrequest");
                    if (paymentMode == null)
                    {
                        paymentMode = ShoppingProcessor.GetPaymentMode("hishop.plugins.payment.alipaywx.alipaywxrequest");
                        if (paymentMode == null)
                        {
                            Globals.WriteLog(nameValueCollection, "支付方式获取失败hishop.plugins.payment.ws_wappay.wswappayrequest", "", "", "alipay");
                            base.Response.Write("success");
                            return;
                        }
                    }
                    this.Notify.Finished          += this.Notify_Finished;
                    this.Notify.NotifyVerifyFaild += this.Notify_NotifyVerifyFaild;
                    this.Notify.Payment           += this.Notify_Payment;
                    this.Notify.VerifyNotify(30000, HiCryptographer.Decrypt(paymentMode.Settings));
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            base.Response.Write("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no\"/>");
            NameValueCollection nameValueCollection = new NameValueCollection
            {
                this.Page.Request.QueryString
            };

            nameValueCollection.Add("IsReturn", "true");
            this.Gateway = "hishop.plugins.payment.ws_wappay.wswappayrequest";
            this.Notify  = PaymentNotify.CreateInstance(this.Gateway, nameValueCollection);
            this.OrderId = this.Notify.GetOrderId();
            this.Order   = ShoppingProcessor.GetOrderInfo(this.OrderId);
            if (this.Order == null)
            {
                base.Response.Write("<p style=\"font-size:16px;\">找不到对应的订单,你付款的订单可能已经被删除</p>");
            }
            else
            {
                this.Amount = this.Notify.GetOrderAmount();
                if (this.Amount <= decimal.Zero)
                {
                    this.Amount = this.Order.GetTotal(false);
                }
                if (this.Order.PreSaleId > 0 && this.Order.DepositGatewayOrderId.ToNullString() == this.Notify.GetGatewayOrderId())
                {
                    base.Response.Write("<p style=\"font-size:16px;\">预售订单,订金已支付成功</p>");
                }
                else
                {
                    if (this.Order.PreSaleId > 0 && !this.Order.DepositDate.HasValue)
                    {
                        this.Order.DepositGatewayOrderId = this.Notify.GetGatewayOrderId();
                    }
                    else
                    {
                        this.Order.GatewayOrderId = this.Notify.GetGatewayOrderId();
                    }
                    PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode("hishop.plugins.payment.ws_wappay.wswappayrequest");
                    if (paymentMode == null)
                    {
                        paymentMode = ShoppingProcessor.GetPaymentMode("hishop.plugins.payment.alipaywx.alipaywxrequest");
                        if (paymentMode == null)
                        {
                            base.Response.Write("<p style=\"font-size:16px;\">找不到对应的支付方式,该支付方式可能已经被删除</p>");
                            return;
                        }
                    }
                    this.Notify.Finished          += this.Notify_Finished;
                    this.Notify.NotifyVerifyFaild += this.Notify_NotifyVerifyFaild;
                    this.Notify.Payment           += this.Notify_Payment;
                    this.Notify.VerifyNotify(30000, HiCryptographer.Decrypt(paymentMode.Settings));
                }
            }
        }
Example #30
0
        public bool AppCheckEmailVerifyCode(string email, string verifyCode)
        {
            string text = HiCache.Get($"DataCache-EmailCode-{email}").ToNullString();

            if (!string.IsNullOrEmpty(text))
            {
                text = HiCryptographer.Decrypt(text);
                return(string.Compare(text, verifyCode, true, CultureInfo.InvariantCulture) == 0);
            }
            return(false);
        }