mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
feat(work): 新增小程序接入对外收款相关接口
This commit is contained in:
parent
4163232f0f
commit
bbf970d3ed
@ -26,43 +26,44 @@
|
||||
|
||||
<summary>[展开查看]</summary>
|
||||
|
||||
| | 微信 API | 开发模式 | 备注 |
|
||||
| :-: | :-------------------------------: | :-------------------------------: | :----------------------------: |
|
||||
| √ | 开发接入 | 企业 & 第三方 & 服务商 & 智慧硬件 | |
|
||||
| √ | 基础:通讯录管理 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:身份验证 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:企业互联 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:上下游 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:消息推送 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:应用管理 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:素材管理 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:电子发票 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:应用授权 | 第三方 & 服务商 | |
|
||||
| √ | 基础:接口调用许可 | 第三方 & 服务商 | |
|
||||
| √ | 基础:收银台 | 第三方 & 服务商 | |
|
||||
| √ | 基础:推广二维码 | 第三方 & 服务商 | |
|
||||
| √ | 基础:账号 ID | 第三方 & 服务商 | |
|
||||
| √ | 连接微信:客户联系 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 连接微信:微信客服 | 企业 & 第三方 & 服务商 | |
|
||||
| × | <del>连接微信:企业支付</del> | 企业 & 第三方 & 服务商 | 异构协议,请使用 TenpayV2 模块 |
|
||||
| × | <del>连接微信:会话内容存档</del> | 企业 | 异构协议,需独立模块 |
|
||||
| √ | 连接微信:家校沟通 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 连接微信:家校应用 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 连接微信:政民沟通 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:邮件 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:文档 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:日程 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:会议 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:微盘 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:直播 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:公费电话 | 企业 | |
|
||||
| √ | 办公:打卡 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:审批 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:汇报 | 企业 | |
|
||||
| √ | 办公:人事助手 | 企业 | |
|
||||
| √ | 办公:会议室 | 企业 | |
|
||||
| √ | 办公:紧急通知 | 企业 | |
|
||||
| √ | 智慧硬件 | 第三方 | |
|
||||
| √ | 硬件云端接入 | 智慧硬件 | |
|
||||
| | 微信 API | 开发模式 | 备注 |
|
||||
| :-: | :---------------------------: | :-------------------------------: | :----------------------------: |
|
||||
| √ | 开发接入 | 企业 & 第三方 & 服务商 & 智慧硬件 | |
|
||||
| √ | 基础:账号 ID | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:通讯录管理 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:身份验证 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:企业互联 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:上下游 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:消息推送 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:应用管理 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:素材管理 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:电子发票 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 基础:应用授权 | 第三方 & 服务商 | |
|
||||
| √ | 基础:接口调用许可 | 第三方 & 服务商 | |
|
||||
| √ | 基础:收银台 | 第三方 & 服务商 | |
|
||||
| √ | 基础:推广二维码 | 第三方 & 服务商 | |
|
||||
| √ | 连接微信:客户联系 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 连接微信:微信客服 | 企业 & 第三方 & 服务商 | |
|
||||
| × | <del>连接微信:企业支付</del> | 企业 & 第三方 & 服务商 | 异构协议,请使用 TenpayV2 模块 |
|
||||
| √ | 连接微信:小程序接入对外收款 | 企业 | |
|
||||
| √ | 连接微信:会话内容存档 | 企业 | |
|
||||
| √ | 连接微信:家校沟通 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 连接微信:家校应用 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 连接微信:政民沟通 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:邮件 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:文档 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:日程 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:会议 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:微盘 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:直播 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:公费电话 | 企业 | |
|
||||
| √ | 办公:打卡 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:审批 | 企业 & 第三方 & 服务商 | |
|
||||
| √ | 办公:汇报 | 企业 | |
|
||||
| √ | 办公:人事助手 | 企业 | |
|
||||
| √ | 办公:会议室 | 企业 | |
|
||||
| √ | 办公:紧急通知 | 企业 | |
|
||||
| √ | 智慧硬件 | 第三方 | |
|
||||
| √ | 硬件云端接入 | 智慧硬件 | |
|
||||
|
||||
</details>
|
||||
|
@ -47,11 +47,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款币种。
|
||||
/// <para>默认值:CNY</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("currency")]
|
||||
public string Currency { get; set; } = "CNY";
|
||||
public string Currency { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户支付金额(单位:分)。
|
||||
|
@ -36,6 +36,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
return await client.SendRequestAsync<Models.CgibinMiniAppPayUploadImageResponse>(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
#region Applyment
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/miniapppay/apply_mch 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98973 </para>
|
||||
@ -75,5 +76,162 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMiniAppPayGetApplymentStatusResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Bill
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/miniapppay/get_bill 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98115 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMiniAppPayGetBillResponse> ExecuteCgibinMiniAppPayGetBillAsync(this WechatWorkClient client, Models.CgibinMiniAppPayGetBillRequest 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
|
||||
.CreateRequest(request, HttpMethod.Get, "cgi-bin", "miniapppay", "get_bill")
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("mchid", request.MerchantId)
|
||||
.SetQueryParam("bill_date", request.BillDateString)
|
||||
.SetQueryParam("bill_type", request.BillType)
|
||||
.SetQueryParam("tar_type", request.TarType);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMiniAppPayGetBillResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Order
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/miniapppay/create_order 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97322 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMiniAppPayCreateOrderResponse> ExecuteCgibinMiniAppPayCreateOrderAsync(this WechatWorkClient client, Models.CgibinMiniAppPayCreateOrderRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "miniapppay", "create_order")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMiniAppPayCreateOrderResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/miniapppay/get_order 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97323 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMiniAppPayGetOrderResponse> ExecuteCgibinMiniAppPayGetOrderAsync(this WechatWorkClient client, Models.CgibinMiniAppPayGetOrderRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "miniapppay", "get_order")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMiniAppPayGetOrderResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/miniapppay/close_order 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97324 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMiniAppPayCloseOrderResponse> ExecuteCgibinMiniAppPayCloseOrderAsync(this WechatWorkClient client, Models.CgibinMiniAppPayCloseOrderRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "miniapppay", "close_order")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMiniAppPayCloseOrderResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/miniapppay/get_sign 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98130 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMiniAppPayGetSignResponse> ExecuteCgibinMiniAppPayGetSignAsync(this WechatWorkClient client, Models.CgibinMiniAppPayGetSignRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.Nonce == null)
|
||||
request.Nonce = Guid.NewGuid().ToString("N");
|
||||
|
||||
if (request.Timestamp == null)
|
||||
request.Timestamp = DateTimeOffset.Now.ToLocalTime().ToUnixTimeSeconds();
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "miniapppay", "get_sign")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMiniAppPayGetSignResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Refund
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/miniapppay/refund 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97333 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMiniAppPayRefundResponse> ExecuteCgibinMiniAppPayRefundAsync(this WechatWorkClient client, Models.CgibinMiniAppPayRefundRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "miniapppay", "refund")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMiniAppPayRefundResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/miniapppay/get_refund_detail 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97352 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinMiniAppPayGetRefundDetailResponse> ExecuteCgibinMiniAppPayGetRefundDetailAsync(this WechatWorkClient client, Models.CgibinMiniAppPayGetRefundDetailRequest 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
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "miniapppay", "get_refund_detail")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinMiniAppPayGetRefundDetailResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/miniapppay/get_bill 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayGetBillRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string MerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账单日期字符串(格式:yyyy-MM-dd)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string BillDateString { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账单类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? BillType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置压缩类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? TarType { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/miniapppay/get_bill 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayGetBillResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置哈希类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hash_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hash_type")]
|
||||
public string HashType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置哈希值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hash_value")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hash_value")]
|
||||
public string HashValue { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账单下载地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("download_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("download_url")]
|
||||
public string DownloadUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置校验头。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("auth")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("auth")]
|
||||
public string Authorization { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniapppay/close_order 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayCloseOrderRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniapppay/close_order 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayCloseOrderResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,251 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniapppay/create_order 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayCreateOrderRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置订单总金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total")]
|
||||
public int Total { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置币种。
|
||||
/// <para>默认值:CNY</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("currency")]
|
||||
public string Currency { get; set; } = "CNY";
|
||||
}
|
||||
|
||||
public class Payer
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置用户的 OpenId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class Scene
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Store
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置门店编号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置门店名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置地区编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("area_code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("area_code")]
|
||||
public string? AreaCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置详细地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("address")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("address")]
|
||||
public string? Address { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户终端 IP。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer_client_ip")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer_client_ip")]
|
||||
public string ClientIp { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户端设备号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("device_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("device_id")]
|
||||
public string? DeviceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户门店信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_info")]
|
||||
public Types.Store? Store { get; set; }
|
||||
}
|
||||
|
||||
public class Detail
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class GoodsDetail
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商户侧商品编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_goods_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_goods_id")]
|
||||
public string MerchantGoodsId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信侧商品编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wechatpay_goods_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wechatpay_goods_id")]
|
||||
public string? WechatpayGoodsId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("goods_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("goods_name")]
|
||||
public string? GoodsName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("quantity")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("quantity")]
|
||||
public int Quantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品单价(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unit_price")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unit_price")]
|
||||
public int UnitPrice { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单原价(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cost_price")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cost_price")]
|
||||
public int? CostPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品小票 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("invoice_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("invoice_id")]
|
||||
public string? InvoiceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置单品列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("goods_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("goods_detail")]
|
||||
public List<Types.GoodsDetail>? GoodsList { 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("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置下单场景 Key。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scenekey")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scenekey")]
|
||||
public string? SceneKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = new Types.Amount();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置支付者信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer")]
|
||||
public Types.Payer Payer { get; set; } = new Types.Payer();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置交易结束时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("time_expire")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("time_expire")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
public DateTimeOffset? ExpireTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置附加数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("attach")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("attach")]
|
||||
public string? Attachment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单优惠标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("goods_tag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("goods_tag")]
|
||||
public string? GoodsTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置场景信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scene_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scene_info")]
|
||||
public Types.Scene Scene { get; set; } = new Types.Scene();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("detail")]
|
||||
public Types.Detail? Detail { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniapppay/create_order 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayCreateOrderResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置预支付交易会话标识 。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("prepay_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("prepay_id")]
|
||||
public string PrepayId { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniapppay/get_order 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayGetOrderRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,278 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniapppay/get_order 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayGetOrderResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Payer
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置用户唯一标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class Amount
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置总金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total")]
|
||||
public int Total { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置币种。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("currency")]
|
||||
public string? Currency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户支付金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer_total")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer_total")]
|
||||
public int? PayerTotal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户支付币种。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer_currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer_currency")]
|
||||
public string? PayerCurrency { get; set; }
|
||||
}
|
||||
|
||||
public class Scene
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商户端设备号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("device_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("device_id")]
|
||||
public string? DeviceId { get; set; }
|
||||
}
|
||||
|
||||
public class Promotion
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class GoodsDetail
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商品编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("goods_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("goods_id")]
|
||||
public string GoodsId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("quantity")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("quantity")]
|
||||
public int Quantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品单价(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unit_price")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unit_price")]
|
||||
public int UnitPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品优惠金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("discount_amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("discount_amount")]
|
||||
public int DiscountAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品备注。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("goods_remark")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("goods_remark")]
|
||||
public string? GoodsRemark { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置券 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("coupon_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("coupon_id")]
|
||||
public string CouponId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠范围。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scope")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scope")]
|
||||
public string Scope { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠券面额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public int Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置活动 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("stock_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("stock_id")]
|
||||
public string? StockId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信出资(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wechatpay_contribute")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wechatpay_contribute")]
|
||||
public int? WechatpayContribute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户出资(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_contribute")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_contribute")]
|
||||
public int? MerchantContribute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置其他出资(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("other_contribute")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("other_contribute")]
|
||||
public int? OtherContribute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠币种。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("currency")]
|
||||
public string? Currency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置单品列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("goods_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("goods_detail")]
|
||||
public Types.GoodsDetail[]? GoodsList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string? TransactionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置交易类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trade_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_type")]
|
||||
public string TradeType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置交易状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trade_state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_state")]
|
||||
public string TradeState { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置交易状态描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trade_state_desc")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_state_desc")]
|
||||
public string TradeStateDescription { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置付款银行类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("bank_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("bank_type")]
|
||||
public string? BankType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置附加数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("attach")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("attach")]
|
||||
public string? Attachment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置支付完成时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("success_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("success_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
public DateTimeOffset? SuccessTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置支付者信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer")]
|
||||
public Types.Payer? Payer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置场景信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scene_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scene_info")]
|
||||
public Types.Scene? Scene { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("promotion_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("promotion_detail")]
|
||||
public Types.Promotion[]? PromotionList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniapppay/get_sign 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayGetSignRequest : WechatWorkRequest
|
||||
{
|
||||
/// <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("prepay_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("prepay_id")]
|
||||
public string PrepayId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置签名方式。
|
||||
/// <para>默认值:RSA</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sign_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sign_type")]
|
||||
public string SignType { get; set; } = "RSA";
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置随机字符串。如果不指定将由系统自动生成。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("nonce")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("nonce")]
|
||||
public string? Nonce { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置当前时间戳。如果不指定将由系统自动生成。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("timestamp")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("timestamp")]
|
||||
public long? Timestamp { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniapppay/get_sign 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayGetSignResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置签名值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pay_sign")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pay_sign")]
|
||||
public string PaySign { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniapppay/get_refund_detail 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayGetRefundDetailRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_refund_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_refund_no")]
|
||||
public string OutRefundNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,163 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniapppay/get_refund_detail 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayGetRefundDetailResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund")]
|
||||
public int Refund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款币种。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("currency")]
|
||||
public string Currency { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户退款金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer_refund")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer_refund")]
|
||||
public int? PayerRefund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠退款金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("discount_refund")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("discount_refund")]
|
||||
public int? DiscountRefund { get; set; }
|
||||
}
|
||||
|
||||
public class Promotion
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置券 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("promotion_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("promotion_id")]
|
||||
public string PromotionId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠范围。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scope")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scope")]
|
||||
public string Scope { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { 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("refund_amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund_amount")]
|
||||
public int RefundAmount { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付退款号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund_id")]
|
||||
public string RefundId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_refund_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_refund_no")]
|
||||
public string OutRefundNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string TransactionId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款渠道。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("channel")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("channel")]
|
||||
public string Channel { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款入账账户。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user_received_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user_received_account")]
|
||||
public string UserReceivedAccount { 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("success_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("success_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
public DateTimeOffset? SuccessTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款创建时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("create_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠退款信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("promotion_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("promotion_detail")]
|
||||
public Types.Promotion[]? PromotionList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniapppay/refund 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayRefundRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置原订单金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total")]
|
||||
public int Total { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund")]
|
||||
public int Refund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款币种。
|
||||
/// <para>默认值:CNY</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("currency")]
|
||||
public string Currency { get; set; } = "CNY";
|
||||
}
|
||||
}
|
||||
|
||||
/// <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("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_refund_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_refund_no")]
|
||||
public string OutRefundNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款原因。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("reason")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("reason")]
|
||||
public string? Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款资金来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("funds_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("funds_account")]
|
||||
public string? FundsAccount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = new Types.Amount();
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/miniapppay/refund 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinMiniAppPayRefundResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount : CgibinMiniAppPayGetRefundDetailResponse.Types.Amount
|
||||
{
|
||||
}
|
||||
|
||||
public class Promotion : CgibinMiniAppPayGetRefundDetailResponse.Types.Promotion
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_refund_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_refund_no")]
|
||||
public string OutRefundNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠退款信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("promotion_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("promotion_detail")]
|
||||
public Types.Promotion[]? PromotionList { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"download_url": "xxx",
|
||||
"hash_type": "xxx",
|
||||
"hash_value": "xxx",
|
||||
"auth": "xxx"
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"mchid": "xxx",
|
||||
"out_trade_no": "xxx"
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
{
|
||||
"appid": "xx",
|
||||
"mchid": "xx",
|
||||
"out_trade_no": "xxxx",
|
||||
"description": "xxxxx",
|
||||
"scenekey": "xxxx",
|
||||
"amount": {
|
||||
"total": 100,
|
||||
"currency": "CNY"
|
||||
},
|
||||
"payer": {
|
||||
"openid": "xxx"
|
||||
},
|
||||
"time_expire": "2015-05-20T13:29:35+08:00",
|
||||
"attach": "xxxxx",
|
||||
"goods_tag": "xxxxxxx",
|
||||
"scene_info": {
|
||||
"payer_client_ip": "127.0.0.1",
|
||||
"device_id": "xxxxxxx",
|
||||
"store_info": {
|
||||
"id": "xxxx",
|
||||
"name": "xxxx",
|
||||
"area_code": "xxxx",
|
||||
"address": "xxxxx"
|
||||
}
|
||||
},
|
||||
"detail": {
|
||||
"cost_price": 123,
|
||||
"invoice_id": "asdfasdfasdf",
|
||||
"goods_detail": [
|
||||
{
|
||||
"merchant_goods_id": "xxxx",
|
||||
"wechatpay_goods_id": "xxxx",
|
||||
"goods_name": "iPhoneX 256G",
|
||||
"quantity": 1,
|
||||
"unit_price": 828800
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"prepay_id": "xxxxxx",
|
||||
"errcode": 0,
|
||||
"errmsg": "ok"
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"mchid": "xxx",
|
||||
"out_trade_no": "xxx"
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"mchid": "xxx",
|
||||
"out_trade_no": "xxxx",
|
||||
"trade_state": "xxx",
|
||||
"trade_state_desc": "xxx",
|
||||
"payer": {
|
||||
"openid": "xxxxxx"
|
||||
},
|
||||
"transaction_id": "xxxxxxxx"
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"appid": "wx1cce664e7cdcf31a",
|
||||
"prepay_id": "wx111925097328382762a266f5cefb640000",
|
||||
"sign_type": "RSA",
|
||||
"nonce": "fqDdjLywAmNDZleCWfPsfhlInxnwnOLK",
|
||||
"timestamp": 1675219608
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"pay_sign": "mHIpSqqf1EnBHAOZ5EE3CJRmgHeRcEsfHg0zhOWs+recA6LrHiHZwWT1M6/+ZvzztOkwjnnx8We4n/xX0mNWM5A6eUQYXE9CEgQKVKPIHVXmsheJqPUIiOXXoRaFY7byLzjkQXcGrNG9iDXdhzwCFeQSNXs072uN+2QRoA+mk0pBiY/uPdFXPBPx8nd5FJshrsnzEGmS+nLbyOfJjTH7SkJPCHuxaDPsf24LD5HRT8bjxMzt/92PZY07NQIQhgcCSqpm758xvEnw43iMNsR2ieUNjwkWyQo+SHvDxr2jn/zmT6JmWhtF+ull+jdptfoRPm/oZsPoqGZfHpc2VSrzMA==",
|
||||
"errcode": 0,
|
||||
"errmsg": "ok"
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"mchid": "xxx",
|
||||
"out_refund_no": "xxx"
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
{
|
||||
"out_refund_no": "1217752501201407033233368018",
|
||||
"out_trade_no": "1217752501201407033233368018",
|
||||
"channel": "ORIGINAL",
|
||||
"user_received_account": "招商银行信用卡0403",
|
||||
"success_time": "2018-06-08T10:34:56+08:00",
|
||||
"create_time": "2018-06-08T10:34:56+08:00",
|
||||
"status": "SUCCESS",
|
||||
"amount": {
|
||||
"refund": 888,
|
||||
"payer_refund": 888,
|
||||
"discount_refund": 888,
|
||||
"currency": "CNY"
|
||||
},
|
||||
"errcode": 0,
|
||||
"errmsg": "ok"
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
{
|
||||
"mchid": "1900000109",
|
||||
"appid": "wx8888888888888888",
|
||||
"out_trade_no": "1217752501201407033233368018",
|
||||
"out_refund_no": "1217752501201407033233368018",
|
||||
"reason": "商品已售完",
|
||||
"funds_account": "AVAILABLE",
|
||||
"amount": {
|
||||
"refund": 888,
|
||||
"total": 888,
|
||||
"currency": "CNY"
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
{
|
||||
"out_refund_no": "1217752501201407033233368018",
|
||||
"amount": {
|
||||
"refund": 888,
|
||||
"currency": "CNY"
|
||||
},
|
||||
"errcode": 0,
|
||||
"errmsg": "ok"
|
||||
}
|
Loading…
Reference in New Issue
Block a user