mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-12-29 01:44:42 +08:00
feat(tenpayv2): 新增企业微信查询红包记录接口
This commit is contained in:
@@ -651,6 +651,8 @@
|
|||||||
|
|
||||||
- 发放企业红包:`SendPayMarketingTransfersWeWorkRedPack`
|
- 发放企业红包:`SendPayMarketingTransfersWeWorkRedPack`
|
||||||
|
|
||||||
|
- 查询红包记录:`GetPayMarketingTransfersWeWorkRedPack`
|
||||||
|
|
||||||
- 向员工付款:
|
- 向员工付款:
|
||||||
|
|
||||||
- 向员工付款:`CreatePayMarketingTransfersPromotionWeWorkTransfer`
|
- 向员工付款:`CreatePayMarketingTransfersPromotionWeWorkTransfer`
|
||||||
|
|||||||
@@ -562,7 +562,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Events
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置投诉进度列表。
|
/// 获取或设置投诉进度列表。
|
||||||
/// <para>等效于 <see cref="Types.EventData.ComplaintHistory"/> </para>
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("history")]
|
[Newtonsoft.Json.JsonProperty("history")]
|
||||||
[Newtonsoft.Json.JsonConverter(typeof(Converters.EventPropertyComplaintHistoryListNewtonsoftJsonConverter))]
|
[Newtonsoft.Json.JsonConverter(typeof(Converters.EventPropertyComplaintHistoryListNewtonsoftJsonConverter))]
|
||||||
|
|||||||
@@ -136,6 +136,28 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2
|
|||||||
|
|
||||||
return await client.SendFlurlRequestAsXmlAsync<Models.SendPayMarketingTransfersWeWorkRedPackResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
return await client.SendFlurlRequestAsXmlAsync<Models.SendPayMarketingTransfersWeWorkRedPackResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /mmpaymkttransfers/queryworkwxredpack 接口。</para>
|
||||||
|
/// <para>
|
||||||
|
/// REF: <br/>
|
||||||
|
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/90276 ]]>
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.GetPayMarketingTransfersWeWorkRedPackResponse> ExecuteGetPayMarketingTransfersWeWorkRedPackAsync(this WechatTenpayClient client, Models.GetPayMarketingTransfersWeWorkRedPackRequest request, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||||
|
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||||
|
|
||||||
|
IFlurlRequest flurlReq = client
|
||||||
|
.CreateFlurlRequest(request, HttpMethod.Post, "mmpaymkttransfers", "queryworkwxredpack");
|
||||||
|
|
||||||
|
return await client.SendFlurlRequestAsXmlAsync<Models.GetPayMarketingTransfersWeWorkRedPackResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>表示 [POST] /mmpaymkttransfers/gethbinfo 接口的请求。</para>
|
/// <para>表示 [POST] /mmpaymkttransfers/gethbinfo 接口的请求。</para>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("mch_billno")]
|
[Newtonsoft.Json.JsonProperty("mch_billno")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("mch_billno")]
|
[System.Text.Json.Serialization.JsonPropertyName("mch_billno")]
|
||||||
public string MerchantBillId { get; set; } = string.Empty;
|
public string MerchantBillNumber { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置订单类型。
|
/// 获取或设置订单类型。
|
||||||
|
|||||||
@@ -22,14 +22,14 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
|||||||
public class ReceiverItem
|
public class ReceiverItem
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置用户的 OpenId。
|
/// 获取或设置领取用户的 OpenId。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("openid")]
|
[Newtonsoft.Json.JsonProperty("openid")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||||
public string OpenId { get; set; } = default!;
|
public string OpenId { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置金额(单位:分)。
|
/// 获取或设置领取金额(单位:分)。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("amount")]
|
[Newtonsoft.Json.JsonProperty("amount")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||||
@@ -70,11 +70,11 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
|||||||
#pragma warning restore CS8618
|
#pragma warning restore CS8618
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置商户定单号。
|
/// 获取或设置商户订单号。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("mch_billno")]
|
[Newtonsoft.Json.JsonProperty("mch_billno")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("mch_billno")]
|
[System.Text.Json.Serialization.JsonPropertyName("mch_billno")]
|
||||||
public string PartnerTradeNumber { get; set; } = default!;
|
public string MerchantBillNumber { get; set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置微信红包订单号。
|
/// 获取或设置微信红包订单号。
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /mmpaymkttransfers/queryworkwxredpack 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class GetPayMarketingTransfersWeWorkRedPackRequest : WechatTenpaySignableRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <inheritdoc/>
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("mch_id")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("mch_id")]
|
||||||
|
public override string? MerchantId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <inheritdoc/>
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("appid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||||
|
public override string? AppId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置商户订单号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("mch_billno")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("mch_billno")]
|
||||||
|
public string MerchantBillNumber { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /mmpaymkttransfers/queryworkwxredpack 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class GetPayMarketingTransfersWeWorkRedPackResponse : WechatTenpaySignableResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <inheritdoc/>
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("mch_id")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("mch_id")]
|
||||||
|
#pragma warning disable CS8618
|
||||||
|
#pragma warning disable CS8765
|
||||||
|
public override string MerchantId { get; set; }
|
||||||
|
#pragma warning restore CS8765
|
||||||
|
#pragma warning restore CS8618
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <inheritdoc/>
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("appid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||||
|
#pragma warning disable CS8618
|
||||||
|
#pragma warning disable CS8765
|
||||||
|
public override string AppId { get; set; }
|
||||||
|
#pragma warning restore CS8765
|
||||||
|
#pragma warning restore CS8618
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置商户订单号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("mch_billno")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("mch_billno")]
|
||||||
|
public string MerchantBillNumber { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置红包单号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("detail_id")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("detail_id")]
|
||||||
|
public string DetailId { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置红包状态。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("status")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||||
|
public string Status { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置发放类型。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("send_type")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("send_type")]
|
||||||
|
public string SendType { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置红包金额(单位:分)。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("total_amount")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("total_amount")]
|
||||||
|
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
|
||||||
|
public int TotalAmount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置红包祝福语。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("wishing")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("wishing")]
|
||||||
|
public string? Wishing { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置活动名称。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("act_name")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("act_name")]
|
||||||
|
public string? ActivityName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置备注。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("remark")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("remark")]
|
||||||
|
public string? Remark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置红包发送时间。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("send_time")]
|
||||||
|
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.BasicDateTimeOffsetConverter))]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("send_time")]
|
||||||
|
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.BasicDateTimeOffsetConverter))]
|
||||||
|
public DateTimeOffset SendTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置红包退款时间。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("refund_time")]
|
||||||
|
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.BasicDateTimeOffsetConverter))]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("refund_time")]
|
||||||
|
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.BasicDateTimeOffsetConverter))]
|
||||||
|
public DateTimeOffset? RefundTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置红包退款金额(单位:分)。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("refund_amount")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("refund_amount")]
|
||||||
|
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
|
||||||
|
public int RefundAmount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置失败原因。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("reason")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("reason")]
|
||||||
|
public string? FailReason { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置红包发送者名称。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("sender_name")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("sender_name")]
|
||||||
|
public string? SenderName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置红包发送者头像 MediaId。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("sender_header_media_id")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("sender_header_media_id")]
|
||||||
|
public string? SenderHeadImageMediaId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置领取红包的用户 OpenId。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("openid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||||
|
public string OpenId { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置领取金额(单位:分)。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("amount")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||||
|
public int Amount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置领取时间。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("rcv_time")]
|
||||||
|
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.BasicDateTimeOffsetConverter))]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("rcv_time")]
|
||||||
|
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.BasicDateTimeOffsetConverter))]
|
||||||
|
public DateTimeOffset ReceiveTime { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"nonce_str": "5K8264ILTKCH16CQ2502SI8ZNMTM67VS",
|
||||||
|
"sign": "C380BEC2BFD727A4B6845133519F3AD6",
|
||||||
|
"mch_billno": "123456",
|
||||||
|
"mch_id": "10000098",
|
||||||
|
"appid": "wx8888888888888888"
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"return_code": "SUCCESS",
|
||||||
|
"return_msg": "ok",
|
||||||
|
"sign": "C380BEC2BFD727A4B6845133519F3AD6",
|
||||||
|
"result_code": "SUCCESS",
|
||||||
|
"mch_billno": "123456",
|
||||||
|
"mch_id": "10000098",
|
||||||
|
"detail_id": "43235678654322356",
|
||||||
|
"status": "RECEIVED",
|
||||||
|
"send_type": "API",
|
||||||
|
"total_amount": "5000",
|
||||||
|
"reason": "余额不足",
|
||||||
|
"send_time": "2017-07-20 22:45:12",
|
||||||
|
"wishing": "新年快乐",
|
||||||
|
"remark": "新年红包",
|
||||||
|
"act_name": "新年红包",
|
||||||
|
"openid": "ohO4GtzOAAYMp2yapORH3dQB3W18",
|
||||||
|
"amount": "100",
|
||||||
|
"rcv_time": "2017-07-20 22:46:59",
|
||||||
|
"sender_name": "XX活动",
|
||||||
|
"sender_header_media_id": "1G6nrLmr5EC3MMb_-zK1dDdzmd0p7cNliYu9V5w7o8K0"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user