Example #1
0
        /// <summary>
        /// 支付通知结果解析
        /// </summary>
        /// <param name="xml">xml</param>
        /// <param name="config">config</param>
        /// <returns>支付通知结果</returns>
        public static PayNotifyResult PayNotify(string xml, Config config)
        {
            var result = TenpayUtil.ConvertToPayNotifyRresult(xml);

            if (result.PayNotifyRresult.IsSuccess)
            {
                if (Signature.VerifySign(result.SignParanmeters, result.SignParanmeters["sign"], config.GetKey()))
                {
                    return(result.PayNotifyRresult);
                }
                result.PayNotifyRresult.IsSuccess = false;
                result.PayNotifyRresult.Message   = "签名错误";
                return(result.PayNotifyRresult);
            }
            return(result.PayNotifyRresult);
        }