/// <summary>
        /// 返回消息
        /// </summary>
        /// <param name="code">编码</param>
        /// <param name="message">消息</param>
        /// <returns></returns>
        private string Return(string code, string message)
        {
            var xml = new Xml();

            xml.AddCDataNode(code, WechatpayConst.ReturnCode);
            xml.AddCDataNode(message, WechatpayConst.ReturnMessage);
            return(xml.ToString());
        }
Example #2
0
        /// <summary>
        /// 添加Xml节点
        /// </summary>
        /// <param name="xml">Xml操作</param>
        /// <param name="key">键</param>
        /// <param name="value">值</param>
        private void AddNode(Xml xml, string key, object value)
        {
            if (key.SafeString().ToLower() == WechatpayConst.TotalFee)
            {
                xml.AddNode(key, value);
                return;
            }

            xml.AddCDataNode(value, key);
        }