protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); //提供微信支付信息 var weixinPay_PartnerId = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_PartnerId"]; var weixinPay_Key = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_Key"]; var weixinPay_AppId = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_AppId"]; var weixinPay_AppKey = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_AppKey"]; var weixinPay_TenpayNotify = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_TenpayNotify"]; var tenPayV3_MchId = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_MchId"]; var tenPayV3_Key = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_Key"]; var tenPayV3_AppId = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_AppId"]; var tenPayV3_AppSecret = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_AppSecret"]; var tenPayV3_TenpayNotify = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_TenpayNotify"]; var weixinPayInfo = new TenPayInfo(weixinPay_PartnerId, weixinPay_Key, weixinPay_AppId, weixinPay_AppKey, weixinPay_TenpayNotify); TenPayInfoCollection.Register(weixinPayInfo); var tenPayV3Info = new TenPayV3Info(tenPayV3_AppId, tenPayV3_AppSecret, tenPayV3_MchId, tenPayV3_Key, tenPayV3_TenpayNotify); TenPayV3InfoCollection.Register(tenPayV3Info); RegisterWeixinThirdParty(); //注册微信第三方平台 }
/// <summary> /// 注册微信支付 /// </summary> private void RegisterWeixinPay() { //提供微信支付信息 var weixinPay_PartnerId = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_PartnerId"]; var weixinPay_Key = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_Key"]; var weixinPay_AppId = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_AppId"]; var weixinPay_AppKey = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_AppKey"]; var weixinPay_TenpayNotify = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_TenpayNotify"]; var tenPayV3_MchId = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_MchId"]; var tenPayV3_Key = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_Key"]; var tenPayV3_AppId = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_AppId"]; var tenPayV3_AppSecret = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_AppSecret"]; var tenPayV3_TenpayNotify = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_TenpayNotify"]; var weixinPayInfo = new TenPayInfo(weixinPay_PartnerId, weixinPay_Key, weixinPay_AppId, weixinPay_AppKey, weixinPay_TenpayNotify); TenPayInfoCollection.Register(weixinPayInfo); var tenPayV3Info = new TenPayV3Info(tenPayV3_AppId, tenPayV3_AppSecret, tenPayV3_MchId, tenPayV3_Key, tenPayV3_TenpayNotify); TenPayV3InfoCollection.Register(tenPayV3Info); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); ThirdPartyConfig.Config(); // Initializes online payment service interface. // Alipay service. HttpContext.Current.Cache.Insert(PaymentService.ALIPAYSERVICE, PayFactory.Create (PaymentService.ALIPAYSERVICE, "2088711708147372", "2i1dmrmyty1nnebyfmu8mmy41awfezmn", "utf-8", "http://www.huodongzaixian.com/pay/alipayresult", "http://www.huodongzaixian.com/pay/alipaynotify")); // Chinabank service, 取消网银在线支付. //HttpContext.Current.Cache.Insert(PaymentService.CHINABANKSERVICE, PayFactory.Create // (PaymentService.CHINABANKSERVICE, "23133137", "shtscs123456789", "utf-8", "http://www.huodongzaixian.com/pay/chinabankresult", "http://www.huodongzaixian.com/pay/chinabanknotify")); //提供微信支付信息 var weixinPay_PartnerId = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_PartnerId"]; var weixinPay_Key = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_Key"]; var weixinPay_AppId = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_AppId"]; var weixinPay_AppKey = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_AppKey"]; var weixinPay_TenpayNotify = System.Configuration.ConfigurationManager.AppSettings["WeixinPay_TenpayNotify"]; var tenPayV3_MchId = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_MchId"]; var tenPayV3_Key = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_Key"]; var tenPayV3_AppId = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_AppId"]; var tenPayV3_AppSecret = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_AppSecret"]; var tenPayV3_TenpayNotify = System.Configuration.ConfigurationManager.AppSettings["TenPayV3_TenpayNotify"]; var weixinPayInfo = new TenPayInfo(weixinPay_PartnerId, weixinPay_Key, weixinPay_AppId, weixinPay_AppKey, weixinPay_TenpayNotify); TenPayInfoCollection.Register(weixinPayInfo); var tenPayV3Info = new TenPayV3Info(tenPayV3_AppId, tenPayV3_AppSecret, tenPayV3_MchId, tenPayV3_Key, tenPayV3_TenpayNotify); TenPayV3InfoCollection.Register(tenPayV3Info); // Start wechat push subscribe demand working thread. Subscription.WorkingThread.Instance.Run(); }
public static void Init(IPlugin plugin) { app = plugin; PluginAttr = plugin.GetAttribute(); initCfg(PluginAttr); InitWeixin(PluginAttr.Settings); //提供微信支付信息 var weixinPay_PartnerId = PluginAttr.Settings["WeixinPay_PartnerId"]; var weixinPay_Key = PluginAttr.Settings["WeixinPay_Key"]; var weixinPay_AppId = PluginAttr.Settings["WeixinPay_AppId"]; var weixinPay_AppKey = PluginAttr.Settings["WeixinPay_AppKey"]; var weixinPay_TenpayNotify = PluginAttr.Settings["WeixinPay_TenpayNotify"]; var tenPayV3_MchId = PluginAttr.Settings["TenPayV3_MchId"]; var tenPayV3_Key = PluginAttr.Settings["TenPayV3_Key"]; var tenPayV3_AppId = PluginAttr.Settings["TenPayV3_AppId"]; var tenPayV3_AppSecret = PluginAttr.Settings["TenPayV3_AppSecret"]; var tenPayV3_TenpayNotify = PluginAttr.Settings["TenPayV3_TenpayNotify"]; var weixinPayInfo = new TenPayInfo(weixinPay_PartnerId, weixinPay_Key, weixinPay_AppId, weixinPay_AppKey, weixinPay_TenpayNotify); TenPayInfoCollection.Register(weixinPayInfo); var tenPayV3Info = new TenPayV3Info(tenPayV3_AppId, tenPayV3_AppSecret, tenPayV3_MchId, tenPayV3_Key, tenPayV3_TenpayNotify); TenPayV3InfoCollection.Register(tenPayV3Info); }