Example #1
0
        /// <summary>
        /// 退款通知结果解析
        /// </summary>
        /// <param name="xml">xml</param>
        /// <param name="config">config</param>
        /// <returns>退款结果</returns>
        public static RefundPayNotifyResult RefundPayNotify(string xml, Config config)
        {
            RefundPayNotifyResult refundPayNotifyResult = new RefundPayNotifyResult();
            var reqInfo = TenpayUtil.GetRefunPayNotifyReqInfo(xml);

            if (reqInfo.Key != null)
            {
                var stringA    = Security.Encrypt32(config.GetKey()).ToLower();
                var reqInfoXml = Security.AesDecrypt(reqInfo.Key, stringA);
                refundPayNotifyResult = TenpayUtil.ConvertToRefundPayNotifyResult(reqInfoXml);
            }
            else
            {
                refundPayNotifyResult.IsSuccess = "CHANGE";
                refundPayNotifyResult.Message   = reqInfo.Value;
            }
            return(refundPayNotifyResult);
        }