예제 #1
0
        /// <summary>
        /// 获取配置参数的方法
        /// </summary>
        public static UnionpayConfigModel GetParams()
        {
            UnionpayConfigModel model = new UnionpayConfigModel();

            model.SecurityKey   = mvcweb.PayConfig.Union.SecurityKey;
            model.MerId         = mvcweb.PayConfig.Union.MemberId;
            model.MerAbbr       = mvcweb.PayConfig.Union.MemberAbbr;
            model.CommodityName = mvcweb.PayConfig.Union.CommodityName;
            return(model);
        }
예제 #2
0
        /// <summary>
        /// 设置配置参数的方法
        /// </summary>
        public static void SetParams(UnionpayConfigModel model)
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(path);
            XmlNode xmlRoot = xmlDoc.DocumentElement;

            xmlRoot.SelectSingleNode("securityKey").InnerText                   = model.SecurityKey;
            xmlRoot.SelectSingleNode("payParamsPredef/merId").InnerText         = model.MerId;
            xmlRoot.SelectSingleNode("payParamsPredef/merAbbr").InnerText       = model.MerAbbr;
            xmlRoot.SelectSingleNode("payParamsPredef/commodityName").InnerText = model.CommodityName;

            xmlDoc.Save(path);
        }