Skip to content

Commit

Permalink
Merge pull request #2983 from JeffreySu/Developer
Browse files Browse the repository at this point in the history
Developer
  • Loading branch information
JeffreySu committed Jan 10, 2024
2 parents 1ef04ba + c22ca62 commit 5f6da57
Show file tree
Hide file tree
Showing 15 changed files with 327 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<p>使用 Senparc.Weixin,您可以方便快速地开发微信全平台的应用(包括微信公众号、小程序、小游戏、企业号、开放平台、微信支付、JS-SDK、微信硬件/蓝牙,等等)。本项目的 Demo 同样适合初学者进行 .NET 编程学习。</p>
<p>
目前 Senparc.Weixin 已经支持几乎所有微信平台模块和接口,并同时支持
<a href="https://github.com/JeffreySu/WeiXinMPSDK/tree/Developer" target="_blank">.NET 3.5 / 4.0 / 4.5 / .NET Standard 2.x / .NET Core 2.x / .NET Core 3.x / .NET 6.0</a> 多种框架。
<a href="https://github.com/JeffreySu/WeiXinMPSDK/tree/Developer" target="_blank">.NET 3.5 / 4.0 / 4.5 / .NET Standard 2.x / .NET Core 2.x / .NET Core 3.x / .NET 6.0 / .NET 8.0</a> 多种框架。
</p>
<p>Senparc.Weixin SDK 是目前使用率最高的微信 .NET SDK,也是国内最受欢迎的 .NET 开源项目之一,是唯一入选 <strong>2021“科创中国”开源创新榜</strong><a href="https://tv.sohu.com/v/dXMvOTkyNjI2MTAvMzI3NjU3NDI0LnNodG1s.html?key=/v/dXMvOTkyNjI2MTAvMzI3NjU3NDI0LnNodG1s.html?vid=327657424&vid=327657424" target="_blank">[1]</a> <a href="https://cccst.org.cn/detail?id=846" target="_blank">[2]</a> 的 .NET 项目。</p>
<p>项目自 2012 年开源,2013 年 1 月起正式发布到 GitHub。10 年来,我们一直保持着项目的持续更新,并将完整的源代码以及设计思想毫无保留地分享给大家,希望有更多的人可以从中受益,理解并传播开源的精神,一同助力中国开源事业!感恩一路上给我们提供帮助的朋友们!</p>
<p>项目自 2012 年开源,2013 年 1 月起正式发布到 GitHub。10 余年来,我们一直保持着项目的持续更新,并将完整的源代码以及设计思想毫无保留地分享给大家,希望有更多的人可以从中受益,理解并传播开源的精神,一同助力中国开源事业!感恩一路上给我们提供帮助的朋友们!</p>
<div id="title_about_team" class="target-fix"></div>
<h5>团队</h5>
<p>Senparc.Weixin 由盛派网络及盛派开发者社区核心团队负责维护,同时正在得到大量来自社区成员和社会各界的支持,欢迎加入我们!</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*----------------------------------------------------------------
Copyright (C) 2023 Senparc
文件名:RequestMessage3rdWxaAuth.cs
文件功能描述:小程序认证年审和过期能力限制提醒(过期当天&过期30天&过期60天)
创建标识:Senparc - 20231211
----------------------------------------------------------------*/

namespace Senparc.Weixin.Open
{
public class RequestMessage3rdWxaWxVerify : RequestMessageBase
{
public override RequestInfoType InfoType
{
get { return RequestInfoType.notify_3rd_wxa_wxverify; }
}
/// <summary>
/// 小程序appid
/// </summary>
public string appid { get; set; }

/// <summary>
/// 认证过期时间戳(秒)
/// </summary>
public long expired { get; set; }

/// <summary>
/// 提醒消息内容
/// </summary>
public string message { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@
Copyright (C) 2024 Senparc
文件名:RequestMessageNicknameAudit.cs
文件功能描述:推送取消授权通知
文件功能描述:小程序昵称审核事件
创建标识:mc7246 - 20190603
----------------------------------------------------------------*/

using System;

namespace Senparc.Weixin.Open
{
/// <summary>
/// 小程序昵称审核事件
/// 该事件已移入小程序SDK,请在小程序SDK内处理
/// </summary>
[Obsolete("此事件请在小程序SDK处理")]
public class RequestMessageNicknameAudit : RequestMessageBase
{
public override RequestInfoType InfoType
Expand Down
6 changes: 5 additions & 1 deletion src/Senparc.Weixin.Open/Senparc.Weixin.Open/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ public enum RequestInfoType
/// <summary>
/// 微信认证推送事件
/// </summary>
notify_3rd_wxa_auth
notify_3rd_wxa_auth,
/// <summary>
/// 小程序认证年审和过期能力限制提醒推送事件
/// </summary>
notify_3rd_wxa_wxverify

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ public void Execute()
ResponseMessageText = On3rdWxaAuthRequest(requestMessage);
}
break;
case RequestInfoType.notify_3rd_wxa_wxverify:
{
var requestMessage = RequestMessage as RequestMessage3rdWxaWxVerify;
ResponseMessageText = On3rdWxaWxVerifyRequest(requestMessage);
}
break;
default:
throw new UnknownRequestMsgTypeException("未知的InfoType请求类型", null);
}
Expand All @@ -206,6 +212,11 @@ public virtual void OnExecuted()
{
}

public virtual string On3rdWxaWxVerifyRequest(RequestMessage3rdWxaWxVerify requestMessage)
{
return "success";
}


public virtual string On3rdWxaAuthRequest(RequestMessage3rdWxaAuth requestMessage)
{
Expand Down Expand Up @@ -270,6 +281,8 @@ public virtual string OnThirdFasteRegisterRequest(RequestMessageThirdFasteRegist
return "success";
}


[Obsolete("此事件请在小程序SDK处理")]
public virtual string OnNicknameAuditRequest(RequestMessageNicknameAudit requestMessage)
{
return "success";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,24 @@ public static IRequestMessageBase GetRequestEntity(XDocument doc, PostModel post
case RequestInfoType.notify_third_fasteregister:
requestMessage = new RequestMessageThirdFasteRegister();
break;
case RequestInfoType.notify_third_fastverifybetaapp:
requestMessage = new RequestMessageFastVerifyBetaApp();
break;
case RequestInfoType.notify_third_fastregisterbetaapp:
requestMessage = new RequestMessageFastRegisterBetaAppApp();
break;
case RequestInfoType.notify_icpfiling_verify_result:
requestMessage = new RequestMessageIcpFilingVerify();
break;
case RequestInfoType.notify_apply_icpfiling_result:
requestMessage = new RequestMessageIcpFilingApply();
break;
case RequestInfoType.notify_3rd_wxa_auth:
requestMessage = new RequestMessage3rdWxaAuth();
break;
case RequestInfoType.notify_3rd_wxa_wxverify:
requestMessage = new RequestMessage3rdWxaWxVerify();
break;
default:
throw new UnknownRequestMsgTypeException(string.Format("InfoType:{0} 在RequestMessageFactory中没有对应的处理程序!", infoType), new ArgumentOutOfRangeException());//为了能够对类型变动最大程度容错(如微信目前还可以对公众账号suscribe等未知类型,但API没有开放),建议在使用的时候catch这个异常
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
<Version>4.17.4</Version>
<Version>4.17.5</Version>
<AssemblyName>Senparc.Weixin.Open</AssemblyName>
<RootNamespace>Senparc.Weixin.Open</RootNamespace>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
Expand Down Expand Up @@ -222,6 +222,7 @@
v4.17.1 新增“小程序微信认证”功能
v4.17.2 添加小程序微信认证事件第三方通知推送 / PR #2969
v4.17.4 修复获取小程序申诉记录返回结果 / PR #2974
v4.17.5 修复微信认证事件通知 PR / #2979
</PackageReleaseNotes>
<RepositoryUrl>https://github.com/JeffreySu/WeiXinMPSDK</RepositoryUrl>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,66 @@ public class QueryAuthJsonResult : WxJsonResult
{
/// <summary>
/// 当前任务流程的状态码:
/// 0: 初始状态 1: 任务超时, 24小时内有效 2: 用户授权拒绝 3: 用户授权同意 4: 发起人脸流程 5: 人脸认证失败 6: 人脸认证ok 7: 人脸认证后,已经提交手机号码下发验证码 8: 手机验证失败 9: 手机验证成功 11: 创建认证审核单失败 12: 创建认证审核审核单成功 14: 验证失败 15: 等待支付 | | auth_url | string | 小程序管理员授权链接 | | apply_status | number | 审核单状态,创建认证审核审核单成功后该值有效。 0:审核单不存在 1:待支付 2:审核中 3:打回重填 4:认证通过 5:认证最终失败(不能再修改) | | orderid | number | 小程序后台展示的认证订单号 | | appid | string | 小程序appid | | refill_reason | string | 当审核单被打回重填(apply_status=3)时有效 | | fail_reason | string | 审核最终失败的原因(apply_status=5)时有效 |
/// </summary>
public int task_status { get; set; }
public TaskStatus task_status { get; set; }

/// <summary>
/// 小程序管理员授权链接
/// </summary>

public string auth_url { get; set; }

/// <summary>
/// 审核单状态,创建认证审核审核单成功后该值有效
/// </summary>
public ApplyStatus apply_status { get; set; }

/// <summary>
/// 小程序后台展示的认证订单号
/// </summary>
public string orderid { get; set; }

/// <summary>
/// 小程序appid
/// </summary>
public string appid { get; set; }

/// <summary>
/// 当审核单被打回重填(apply_status=3)时有效
/// </summary>
public string refill_reason { get; set; }

/// <summary>
/// 审核最终失败的原因(apply_status=5)时有效
/// </summary>
public string fail_reason { get; set; }

public enum TaskStatus
{
初始状态 =0,
任务超时_24小时内有效=1,
用户授权拒绝 = 2,
用户授权同意=3,
发起人脸流程=4,
人脸认证失败=5,
人脸认证ok = 6,
人脸认证后_已经提交手机号码下发验证码= 7,
手机验证失败=8,
手机验证成功 =9,
创建认证审核单失败=11,
创建认证审核审核单成功 =12,
验证失败 =14,
等待支付=15
}

public enum ApplyStatus
{
审核单不存在 = 0,
待支付 = 1,
审核中 = 2,
打回重填 = 3,
认证通过 = 4,
认证最终失败_不能再修改 = 5
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#region Apache License Version 2.0
/*----------------------------------------------------------------
Copyright 2023 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions
and limitations under the License.
Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
----------------------------------------------------------------*/
#endregion Apache License Version 2.0

/*----------------------------------------------------------------
Copyright (C) 2023 Senparc
文件名:RequestMessageEvent_AddExpressPath.cs
文件功能描述:运单轨迹更新事件
创建标识:chinanhb - 20230529
----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.WxOpen.Entities
{
public class RequestMessageEvent_WxVerifyDispatch : RequestMessageEventBase,IRequestMessageEventBase
{
/// <summary>
/// 事件类型
/// </summary>
public override Event Event
{
get { return Event.wx_verify_dispatch; }
}
/// <summary>
/// 微信认证审核机构
/// </summary>
public string Provider { get; set; }

/// <summary>
/// 微信认证审核机构联系方式
/// </summary>
public string Contact { get; set; }

/// <summary>
/// 微信认证派单时间
/// </summary>
public long DispatchTime { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#region Apache License Version 2.0
/*----------------------------------------------------------------
Copyright 2023 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions
and limitations under the License.
Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
----------------------------------------------------------------*/
#endregion Apache License Version 2.0

/*----------------------------------------------------------------
Copyright (C) 2023 Senparc
文件名:RequestMessageEvent_AddExpressPath.cs
文件功能描述:运单轨迹更新事件
创建标识:chinanhb - 20230529
----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.WxOpen.Entities
{
public class RequestMessageEvent_WxVerifyPaySucc : RequestMessageEventBase,IRequestMessageEventBase
{
/// <summary>
/// 事件类型
/// </summary>
public override Event Event
{
get { return Event.wx_verify_pay_succ; }
}
/// <summary>
/// 微信认证订单ID
/// </summary>
public string OrderId { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
namespace Senparc.Weixin.WxOpen.Entities
{
/// <summary>
/// 事件之小程序审核成功
/// 事件之小程序类目审核成功
/// </summary>
public class RequestMessageEvent_WxaCategoryAudit : RequestMessageEventBase, IRequestMessageEventBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ public enum Event
/// 订单将要结算或已经结算事件
/// </summary>
trade_manage_order_settlement,

/// <summary>
/// 小程序微信认证支付成功事件
/// </summary>
wx_verify_pay_succ,
/// <summary>
/// 小程序微信认证派单事件
/// </summary>
wx_verify_dispatch,

#region 小程序虚拟支付
/// <summary>
Expand Down

0 comments on commit 5f6da57

Please sign in to comment.