mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-12-29 01:44:42 +08:00
feat(tenpayv3): 新增向用户发放商品券接口
This commit is contained in:
@@ -403,6 +403,8 @@
|
|||||||
|
|
||||||
- 图片上传:`UploadMerchantMediaImage`
|
- 图片上传:`UploadMerchantMediaImage`
|
||||||
|
|
||||||
|
- 向用户发放商品券:`SendMarketingBusifavorProductCoupon`
|
||||||
|
|
||||||
- 消费金
|
- 消费金
|
||||||
|
|
||||||
- 下载批次退款明细:`GetMultiuseStockRefundFlow`
|
- 下载批次退款明细:`GetMultiuseStockRefundFlow`
|
||||||
@@ -1189,6 +1191,8 @@
|
|||||||
|
|
||||||
- 图片上传:`UploadMarketingMediaImage`
|
- 图片上传:`UploadMarketingMediaImage`
|
||||||
|
|
||||||
|
- 向用户发放商品券:`SendMarketingBusifavorProductCoupon`
|
||||||
|
|
||||||
- 委托营销
|
- 委托营销
|
||||||
|
|
||||||
- 建立合作关系:`BuildMarketingPartnership`
|
- 建立合作关系:`BuildMarketingPartnership`
|
||||||
|
|||||||
@@ -473,5 +473,28 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
|||||||
|
|
||||||
return await client.SendFlurlRequestAsJsonAsync<Models.CreateMarketingBusifavorSubsidyReturnReceiptResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
return await client.SendFlurlRequestAsJsonAsync<Models.CreateMarketingBusifavorSubsidyReturnReceiptResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /marketing/busifavor/product-coupons/send 接口。</para>
|
||||||
|
/// <para>
|
||||||
|
/// REF: <br/>
|
||||||
|
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/merchant/4015594964 ]]> <br/>
|
||||||
|
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4015595255 ]]>
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.SendMarketingBusifavorProductCouponResponse> ExecuteSendMarketingBusifavorProductCouponAsync(this WechatTenpayClient client, Models.SendMarketingBusifavorProductCouponRequest 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, "marketing", "busifavor", "product-coupons", "send");
|
||||||
|
|
||||||
|
return await client.SendFlurlRequestAsJsonAsync<Models.SendMarketingBusifavorProductCouponResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /marketing/busifavor/product-coupons/send 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class SendMarketingBusifavorProductCouponRequest : WechatTenpayRequest
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置会员卡 ID。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("member_card_id")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("member_card_id")]
|
||||||
|
public string? MemberCardId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置微信 AppId。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("appid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||||
|
public string AppId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置用户唯一标识。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("openid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||||
|
public string OpenId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置批次号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("stock_id")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("stock_id")]
|
||||||
|
public string StockId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置商户单据号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("out_request_no")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("out_request_no")]
|
||||||
|
public string OutRequestNumber { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置商家券 Code。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("coupon_code")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("coupon_code")]
|
||||||
|
public string? CouponCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置商家券类型。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("coupon_type")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("coupon_type")]
|
||||||
|
public string? CouponType { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /marketing/busifavor/product-coupons/send 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class SendMarketingBusifavorProductCouponResponse : WechatTenpayResponse
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class Result
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置批次号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("stock_id")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("stock_id")]
|
||||||
|
public string StockId { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置商户单据号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("out_request_no")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("out_request_no")]
|
||||||
|
public string OutRequestNumber { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置商家券 Code。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("coupon_code")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("coupon_code")]
|
||||||
|
public string CouponCode { get; set; } = default!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置发券结果信息。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("send_coupon_result")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("send_coupon_result")]
|
||||||
|
public Types.Result Result { get; set; } = default!;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -76,7 +76,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置微信支付平台 API 认证方案回退开关。<br/>
|
/// 获取或设置微信支付平台 API 认证方案回退开关。<br/>
|
||||||
/// 开启后会在验证签名时根据响应或回调中接收到的序列号自动推测使用哪种认证方案。<br/>
|
/// 开启后会在验证签名时根据响应或回调中接收到的序列号自动推测使用哪种认证方案。<br/>
|
||||||
/// 开启后会有一定的性能损耗,建议仅在灰度切换期间时开启,待切换进度为百分之百后请关闭。
|
/// 开启后会有一定的性能损失,建议仅在灰度切换期间时开启,待切换进度为百分之百后请关闭。
|
||||||
/// <para>
|
/// <para>
|
||||||
/// 默认值:false
|
/// 默认值:false
|
||||||
/// </para>
|
/// </para>
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"openid": "xsd3434454567676",
|
||||||
|
"appid": "wx1234567889999",
|
||||||
|
"stock_id": "12312354",
|
||||||
|
"out_request_no": "2335465",
|
||||||
|
"coupon_code": "202007019999",
|
||||||
|
"coupon_type": "NORMAL",
|
||||||
|
"member_card_id": "pbLatjvWOibDc5-TBnbUk1pD12o0"
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"send_coupon_result": {
|
||||||
|
"stock_id": "1262260000000268",
|
||||||
|
"out_request_no": "2335465",
|
||||||
|
"coupon_code": "2312323"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user