Exemplo n.º 1
0
        public static string createPaySign(List <QueryParameter> parameters)
        {
            string        query   = QueryParameter.NormalizeRequestParameters(parameters);
            StringBuilder enValue = new StringBuilder();

            enValue.Append(query);
            enValue.Append("&key=" + WeChatUtilities.getConfigValue(WeChatUtilities.PAYAPI_KEY));
            string sign = CommonUtilities.encrypt_MD5(enValue.ToString()).ToUpper();

            return(sign);
        }
Exemplo n.º 2
0
        /*private string ToUnicodeString(this string str)
         * {
         *  StringBuilder strResult = new StringBuilder();
         *  if (!string.IsNullOrEmpty(str))
         *  {
         *      for (int i = 0; i < str.Length; i++)
         *      {
         *          strResult.Append("\\u");
         *          strResult.Append(((int)str[i]).ToString("x"));
         *      }
         *  }
         *  return strResult.ToString();
         * }*/
        private string SignMD5(string content)
        {
            StringBuilder enValue = new StringBuilder();

            //前后加上secret
            enValue.Append(appsecret);
            enValue.Append(content);
            enValue.Append(appsecret);
            //使用MD5加密(32位小写)
            return(CommonUtilities.encrypt_MD5(enValue.ToString()).ToLower());
        }