static WxPayConfig() { WeixinPayConfigInfo config = WeixinPayConfigInfo.Instance; APPID = config.AppID; APPSECRET = config.AppSecret; MCHID = config.Mch_ID; KEY = config.Key; SSLCERT_PATH = config.Sslcert_Path; SSLCERT_PASSWORD = config.Sslcert_Password; NOTIFY_URL = config.PayNotifyUrl; }
static WeixinPayConfigInfo() { try { Instance = JsonConvert.DeserializeObject <WeixinPayConfigInfo>(File.ReadAllText(HttpContext.Current.Server.MapPath("/Config/WeixinpayConfig.json"))); } catch (Exception ex) { LogHelper.SaveFileLog("解析微信支付配置文件[Config/WeixinpayConfig.json]出错", ex.Message); Instance = null; } }