Пример #1
0
        public static bool CheckSign(SortedDictionary <string, string> tmpParas, string appSecret, ref string message)
        {
            bool flag = BuildSign(Parameterfilter(tmpParas), appSecret, "MD5", "utf-8") == tmpParas["sign"];

            message = flag ? "" : OpenApiErrorMessage.ShowErrorMsg(OpenApiErrorCode.Invalid_Signature, "sign");
            return(flag);
        }
Пример #2
0
        public static string ShowErrorMsg(Enum enumSubitem, string fields)
        {
            string text   = OpenApiErrorMessage.GetEnumDescription(enumSubitem).Replace("_", " ");
            string format = "{{\"error_response\":{{\"code\":\"{0}\",\"msg\":\"{1}:{2}\",\"sub_msg\":\"{3}\"}}}}";

            return(string.Format(format, new object[]
            {
                Convert.ToInt16(enumSubitem).ToString(),
                enumSubitem.ToString().Replace("_", " "),
                fields,
                text
            }));
        }