Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Developer' into Developer-SM
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySu committed Aug 10, 2024
2 parents eec9c87 + b74863a commit b8f4001
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*----------------------------------------------------------------
Copyright (C) 2024 Senparc
文件名:RequestMessage3rdWxaAuth.cs
文件功能描述:小程序订单页设置申请通知
创建标识:mc7246 - 20240802
----------------------------------------------------------------*/

using System.Collections.Generic;

namespace Senparc.Weixin.Open
{
/// <summary>
/// 小程序订单页设置申请通知
/// </summary>
public class RequestMessageOrderPathApplyResultNotify : RequestMessageBase
{
public override RequestInfoType InfoType
{
get { return RequestInfoType.order_path_apply_result_notify; }
}

/// <summary>
/// 送审结果列表
/// </summary>
public RequestMessageOrderPathApplyResultNotify_AppInfo list { get; set; }
}

public class RequestMessageOrderPathApplyResultNotify_AppInfo
{
/// <summary>
/// 申请的appid
/// </summary>
public string appid { get; set; }

/// <summary>
/// 送审结果,0 成功, 1 重复提审,-1 系统繁忙,-2 APPID非法
/// </summary>
public int ret_code { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*----------------------------------------------------------------
Copyright (C) 2024 Senparc
文件名:RequestMessage3rdWxaAuth.cs
文件功能描述:小程序订单页设置审核结果通知
创建标识:mc7246 - 20240802
----------------------------------------------------------------*/

using System.Collections.Generic;

namespace Senparc.Weixin.Open
{
/// <summary>
/// 小程序订单页设置审核结果通知
/// </summary>
public class RequestMessageOrderPathAuditResultNotify : RequestMessageBase
{
public override RequestInfoType InfoType
{
get { return RequestInfoType.order_path_audit_result_notify; }
}

/// <summary>
/// 申请结果列表
/// </summary>
public RequestMessageOrderPathAuditResultNotify_AppInfo list { get; set; }
}

public class RequestMessageOrderPathAuditResultNotify_AppInfo
{
/// <summary>
/// 申请的appid
/// </summary>
public string appid { get; set; }

/// <summary>
/// 审核单id
/// </summary>
public long audit_id { get; set; }

/// <summary>
/// 结果 4成功
/// </summary>
public int status { get; set; }

/// <summary>
/// 申请时间
/// </summary>
public long apply_time { get; set; }
/// <summary>
/// 审核时间
/// </summary>
public long audit_time { get; set; }

/// <summary>
/// 结果说明
/// </summary>
public string reason { get; set; }
}
}
11 changes: 10 additions & 1 deletion src/Senparc.Weixin.Open/Senparc.Weixin.Open/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,16 @@ public enum RequestInfoType
/// <summary>
/// 小程序认证年审和过期能力限制提醒推送事件
/// </summary>
notify_3rd_wxa_wxverify
notify_3rd_wxa_wxverify,

/// <summary>
/// 小程序订单页设置申请通知
/// </summary>
order_path_apply_result_notify,
/// <summary>
/// 小程序订单页设置审核结果通知
/// </summary>
order_path_audit_result_notify

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,18 @@ public void Execute()
ResponseMessageText = On3rdWxaWxVerifyRequest(requestMessage);
}
break;
case RequestInfoType.order_path_apply_result_notify:
{
var requestMessage = RequestMessage as RequestMessageOrderPathApplyResultNotify;
ResponseMessageText = OnOrderPathApplyResultNorifyRequest(requestMessage);
}
break;
case RequestInfoType.order_path_audit_result_notify:
{
var requestMessage = RequestMessage as RequestMessageOrderPathAuditResultNotify;
ResponseMessageText = OnOrderPathAuditResultNotifyRequest(requestMessage);
}
break;
default:
throw new UnknownRequestMsgTypeException("未知的InfoType请求类型", null);
}
Expand All @@ -212,6 +224,26 @@ public virtual void OnExecuted()
{
}

/// <summary>
/// 小程序订单页设置申请结果通知
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual string OnOrderPathApplyResultNorifyRequest(RequestMessageOrderPathApplyResultNotify requestMessage)
{
return "success";
}

/// <summary>
/// 小程序订单页设置申请审核结果通知
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual string OnOrderPathAuditResultNotifyRequest(RequestMessageOrderPathAuditResultNotify requestMessage)
{
return "success";
}

public virtual string On3rdWxaWxVerifyRequest(RequestMessage3rdWxaWxVerify requestMessage)
{
return "success";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ public static IRequestMessageBase GetRequestEntity(XDocument doc, PostModel post
case RequestInfoType.notify_3rd_wxa_wxverify:
requestMessage = new RequestMessage3rdWxaWxVerify();
break;
case RequestInfoType.order_path_apply_result_notify:
requestMessage = new RequestMessageOrderPathApplyResultNotify();
break;
case RequestInfoType.order_path_audit_result_notify:
requestMessage = new RequestMessageOrderPathAuditResultNotify();
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
Expand Up @@ -172,8 +172,8 @@ public static WxJsonResult SetMsgJumpPath(string accessToken, string path, int t
/// 查询小程序是否已开通发货信息管理服务
/// https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html#%E4%B8%83%E3%80%81%E6%9F%A5%E8%AF%A2%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%98%AF%E5%90%A6%E5%B7%B2%E5%BC%80%E9%80%9A%E5%8F%91%E8%B4%A7%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E6%9C%8D%E5%8A%A1
/// </summary>
/// <param name="accessToken"></param>
/// <param name="path">商户自定义跳转路径。</param>
/// <param name="accessToken">接口调用凭证</param>
/// <param name="appid">待查询小程序的 appid</param>
/// <param name="timeOut"></param>
/// <returns></returns>
public static IsTradeManagedJsonResult IsTradeManaged(string accessToken, string appid, int timeOut = Config.TIME_OUT)
Expand All @@ -185,6 +185,24 @@ public static IsTradeManagedJsonResult IsTradeManaged(string accessToken, string
};
return CommonJsonSend.Send<IsTradeManagedJsonResult>(null, url, data, CommonJsonSendType.POST, timeOut);
}

/// <summary>
/// 查询小程序是否已完成交易结算管理确认
/// https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html#%E5%85%AB%E3%80%81%E6%9F%A5%E8%AF%A2%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%98%AF%E5%90%A6%E5%B7%B2%E5%AE%8C%E6%88%90%E4%BA%A4%E6%98%93%E7%BB%93%E7%AE%97%E7%AE%A1%E7%90%86%E7%A1%AE%E8%AE%A4
/// </summary>
/// <param name="accessToken">接口调用凭证</param>
/// <param name="appid">待查询小程序的 appid</param>
/// <param name="timeOut"></param>
/// <returns></returns>
public static IsTradeManagementConfirmationCompletedJsonResult IsTradeManagementConfirmationCompleted(string accessToken, string appid, int timeOut = Config.TIME_OUT)
{
var url = string.Format(Config.ApiMpHost + "/wxa/sec/order/is_trade_management_confirmation_completed?access_token={0}", accessToken.AsUrlData());
var data = new
{
appid
};
return CommonJsonSend.Send<IsTradeManagementConfirmationCompletedJsonResult>(null, url, data, CommonJsonSendType.POST, timeOut);
}
#endregion

#region 异步方法
Expand Down Expand Up @@ -312,8 +330,8 @@ public static async Task<WxJsonResult> SetMsgJumpPathAsync(string accessToken, s
/// 查询小程序是否已开通发货信息管理服务
/// https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html#%E4%B8%83%E3%80%81%E6%9F%A5%E8%AF%A2%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%98%AF%E5%90%A6%E5%B7%B2%E5%BC%80%E9%80%9A%E5%8F%91%E8%B4%A7%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E6%9C%8D%E5%8A%A1
/// </summary>
/// <param name="accessToken"></param>
/// <param name="path">商户自定义跳转路径。</param>
/// <param name="accessToken">接口调用凭证</param>
/// <param name="appid">待查询小程序的 appid</param>
/// <param name="timeOut"></param>
/// <returns></returns>
public static async Task<IsTradeManagedJsonResult> IsTradeManagedAsync(string accessToken, string appid, int timeOut = Config.TIME_OUT)
Expand All @@ -325,6 +343,24 @@ public static async Task<IsTradeManagedJsonResult> IsTradeManagedAsync(string ac
};
return await CommonJsonSend.SendAsync<IsTradeManagedJsonResult>(null, url, data, CommonJsonSendType.POST, timeOut);
}

/// <summary>
/// 查询小程序是否已完成交易结算管理确认
/// https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html#%E5%85%AB%E3%80%81%E6%9F%A5%E8%AF%A2%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%98%AF%E5%90%A6%E5%B7%B2%E5%AE%8C%E6%88%90%E4%BA%A4%E6%98%93%E7%BB%93%E7%AE%97%E7%AE%A1%E7%90%86%E7%A1%AE%E8%AE%A4
/// </summary>
/// <param name="accessToken">接口调用凭证</param>
/// <param name="appid">待查询小程序的 appid</param>
/// <param name="timeOut"></param>
/// <returns></returns>
public static async Task<IsTradeManagementConfirmationCompletedJsonResult> IsTradeManagementConfirmationCompletedAsync(string accessToken, string appid, int timeOut = Config.TIME_OUT)
{
var url = string.Format(Config.ApiMpHost + "/wxa/sec/order/is_trade_management_confirmation_completed?access_token={0}", accessToken.AsUrlData());
var data = new
{
appid
};
return await CommonJsonSend.SendAsync<IsTradeManagementConfirmationCompletedJsonResult>(null, url, data, CommonJsonSendType.POST, timeOut);
}
#endregion
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Senparc.Weixin.Entities;

namespace Senparc.Weixin.Open.WxaAPIs.SecOrder
{
/// <summary>
/// 查询小程序是否已完成交易结算管理确认
/// </summary>
public class IsTradeManagementConfirmationCompletedJsonResult : WxJsonResult
{
public bool completed { get; set; }
}
}

0 comments on commit b8f4001

Please sign in to comment.