Beispiel #1
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"));
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string            openIdType     = "hishop.plugins.openid.alipay.alipayservice";
            OpenIdSettingInfo openIdSettings = OpenIdHelper.GetOpenIdSettings(openIdType);

            if (openIdSettings != null)
            {
                string      value       = base.Request.QueryString["alipaytoken"];
                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.XmlResolver = null;
                xmlDocument.LoadXml(HiCryptographer.Decrypt(openIdSettings.Settings));
                SortedDictionary <string, string> sortedDictionary = new 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("openid/LogisticsAddress_url"));
                sortedDictionary.Add("token", value);
                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");
                StringBuilder stringBuilder = new StringBuilder();
                foreach (KeyValuePair <string, string> item in dictionary)
                {
                    stringBuilder.Append(OpenIdFunction.CreateField(item.Key, item.Value));
                }
                sortedDictionary.Clear();
                dictionary.Clear();
                OpenIdFunction.Submit(OpenIdFunction.CreateForm(stringBuilder.ToString(), "https://mapi.alipay.com/gateway.do?_input_charset=utf-8"));
            }
        }
Beispiel #3
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"));
            }
        }