Skip to content

Commit

Permalink
Merge pull request #1331 from JeffreySu/Developer
Browse files Browse the repository at this point in the history
Developer
  • Loading branch information
JeffreySu authored Aug 3, 2018
2 parents 9e1f006 + 22b8e77 commit 33078f2
Show file tree
Hide file tree
Showing 49 changed files with 517 additions and 249 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Senparc.Weixin.Work;
using System.Collections.Generic;
using System.IO;
using Senparc.Weixin.WxOpen;

namespace Senparc.Weixin.MP.CoreSample
{
Expand Down Expand Up @@ -197,61 +198,38 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, IOptions

#region 注册公众号或小程序(按需)

//注册公众号
.RegisterMpAccount(
senparcWeixinSetting.Value.WeixinAppId,
senparcWeixinSetting.Value.WeixinAppSecret,
"【盛派网络小助手】公众号")
//注册多个公众号或小程序
.RegisterMpAccount(
senparcWeixinSetting.Value.WxOpenAppId,
senparcWeixinSetting.Value.WxOpenAppSecret,
"【盛派网络小助手】小程序")//注意:小程序和公众号的AppId/Secret属于并列关系,这里name需要区分开
//注册公众号(可注册多个)
.RegisterMpAccount(senparcWeixinSetting.Value, "【盛派网络小助手】公众号")
//注册多个公众号或小程序(可注册多个)
.RegisterWxOpenAccount(senparcWeixinSetting.Value, "【盛派网络小助手】小程序")

//除此以外,仍然可以在程序任意地方注册公众号或小程序:
//AccessTokenContainer.Register(appId, appSecret, name);//命名空间:Senparc.Weixin.MP.Containers
#endregion

#region 注册企业号(按需)

//注册企业微信
.RegisterWorkAccount(
senparcWeixinSetting.Value.WeixinCorpId,
senparcWeixinSetting.Value.WeixinCorpSecret,
"【盛派网络】企业微信")
//还可注册任意多个企业号
//注册企业微信(可注册多个)
.RegisterWorkAccount(senparcWeixinSetting.Value, "【盛派网络】企业微信")

//除此以外,仍然可以在程序任意地方注册企业微信:
//AccessTokenContainer.Register(corpId, corpSecret, name);//命名空间:Senparc.Weixin.Work.Containers
#endregion

#region 注册微信支付(按需)

//注册旧微信支付版本(V2)
.RegisterTenpayOld(() =>
{
//提供微信支付(旧版本)信息
var weixinPayInfo = new TenPayInfo(senparcWeixinSetting.Value);
return weixinPayInfo;
},
"【盛派网络小助手】公众号"//这里的 name 和第一个 RegisterMpAccount() 中的一致,会被记录到同一个 SenparcWeixinSettingItem 对象中
)
//注册最新微信支付版本(V3)
.RegisterTenpayV3(() =>
{
//提供微信支付(新版本 V3)信息
var tenPayV3Info = new TenPayV3Info(senparcWeixinSetting.Value);
return tenPayV3Info;
}, "【盛派网络小助手】公众号")//记录到同一个 SenparcWeixinSettingItem 对象中
//注册旧微信支付版本(V2)(可注册多个)
.RegisterTenpayOld(senparcWeixinSetting.Value, "【盛派网络小助手】公众号")//这里的 name 和第一个 RegisterMpAccount() 中的一致,会被记录到同一个 SenparcWeixinSettingItem 对象中

//注册最新微信支付版本(V3)(可注册多个)
.RegisterTenpayV3(senparcWeixinSetting.Value, "【盛派网络小助手】公众号")//记录到同一个 SenparcWeixinSettingItem 对象中

#endregion

#region 注册微信第三方平台(按需)

.RegisterOpenComponent(
senparcWeixinSetting.Value.Component_Appid,
senparcWeixinSetting.Value.Component_Secret,

//注册第三方平台(可注册多个)
.RegisterOpenComponent(senparcWeixinSetting.Value,
//getComponentVerifyTicketFunc
componentAppId =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Senparc.CO2NET, Version=0.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Senparc.CO2NET.0.2.0\lib\net45\Senparc.CO2NET.dll</HintPath>
<Reference Include="Senparc.CO2NET, Version=0.2.6.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Senparc.CO2NET.0.2.6\lib\net45\Senparc.CO2NET.dll</HintPath>
</Reference>
<Reference Include="Senparc.CO2NET.Cache.Redis.RedLock, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Senparc.CO2NET.Cache.Redis.RedLock.1.0.0\lib\net45\Senparc.CO2NET.Cache.Redis.RedLock.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net45" />
<package id="NETStandard.Library" version="1.6.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
<package id="Senparc.CO2NET" version="0.2.0" targetFramework="net45" />
<package id="Senparc.CO2NET" version="0.2.6" targetFramework="net45" />
<package id="Senparc.CO2NET.Cache.Redis.RedLock" version="1.0.0" targetFramework="net45" />
<package id="StackExchange.Redis" version="1.2.6" targetFramework="net45" />
<package id="System.Collections" version="4.3.0" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Senparc.CO2NET, Version=0.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Senparc.CO2NET.0.2.0\lib\net45\Senparc.CO2NET.dll</HintPath>
<Reference Include="Senparc.CO2NET, Version=0.2.6.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Senparc.CO2NET.0.2.6\lib\net45\Senparc.CO2NET.dll</HintPath>
</Reference>
<Reference Include="Senparc.CO2NET.Cache.Redis.RedLock, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Senparc.CO2NET.Cache.Redis.RedLock.1.0.0\lib\net45\Senparc.CO2NET.Cache.Redis.RedLock.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<package id="Moq" version="4.9.0" targetFramework="net45" />
<package id="NETStandard.Library" version="1.6.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
<package id="Senparc.CO2NET" version="0.2.0" targetFramework="net45" />
<package id="Senparc.CO2NET" version="0.2.6" targetFramework="net45" />
<package id="Senparc.CO2NET.Cache.Redis.RedLock" version="1.0.0" targetFramework="net45" />
<package id="StackExchange.Redis" version="1.2.6" targetFramework="net45" />
<package id="System.Collections" version="4.3.0" targetFramework="net45" />
Expand Down
Loading

0 comments on commit 33078f2

Please sign in to comment.