/// <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); }
/// <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); }