Skip to content

Commit

Permalink
feat(tenpayv3): 新增服务商教育续费通相关接口
Browse files Browse the repository at this point in the history
  • Loading branch information
fudiwei committed May 15, 2024
1 parent cb827a0 commit 31ba9c3
Show file tree
Hide file tree
Showing 17 changed files with 249 additions and 17 deletions.
20 changes: 19 additions & 1 deletion docs/WechatTenpayV3/Basic_ModelDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
|| 其他:ETC 扣费 | 合作伙伴 | |
|| 其他:电子小票 | 合作伙伴 | |
|| 其他:出租车电子发票 | 合作伙伴 | |
|| 其他:教育续费通 | 直连商户 | |
|| 其他:教育续费通 | 直连商户 & 合作伙伴 | |
|| 其他:校园轻松付 | 合作伙伴 | |
|| 其他:微信点餐订单 | 合作伙伴 | |
|| 其他:微信寄快递 | 合作伙伴 | |
Expand Down Expand Up @@ -1294,6 +1294,24 @@

- 将出租车电子发票插入微信用户卡包:`CreateTaxiInvoiceCard`

- 教育续费通:

- 预签约:`PresignEducationPAPayContract`

- 通过协议号查询签约:`GetEducationPAPayContractByContractId`

- 通过用户标识查询签约:`QueryEducationPAPayUserContracts`

- 解约:`TerminateEducationPAPayContract`

- 发送扣款预通知:`SendEducationPAPayContractNotification`

- 教育通扣款受理:`CreateEducationPAPayTransaction`

- 微信订单号查单:`GetEducationPAPayTransactionById`

- 商户订单号查单:`GetEducationPAPayTransactionByOutTradeNumber`

- 校园轻松付:

- 预签约:`PresignEducationSchoolPayContract`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public static class WechatTenpayClientExecuteEducationPAPayExtensions
/// <para>异步调用 [POST] /edu-papay/contracts/presign 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/wiki/doc/apiv3/Offline/apis/chapter5_2_1.shtml ]]>
/// <![CDATA[ https://pay.weixin.qq.com/docs/merchant/apis/education-fee-payment/contracts/pre-sign.html ]]> <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/education-fee-payment/contracts/pre-sign.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
Expand All @@ -34,7 +35,8 @@ public static class WechatTenpayClientExecuteEducationPAPayExtensions
/// <para>异步调用 [GET] /edu-papay/contracts/id/{contract_id} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/wiki/doc/apiv3/Offline/apis/chapter5_2_2.shtml ]]>
/// <![CDATA[ https://pay.weixin.qq.com/docs/merchant/apis/education-fee-payment/contracts/query-contract.html ]]> <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/education-fee-payment/contracts/query-contract.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
Expand All @@ -50,14 +52,21 @@ public static class WechatTenpayClientExecuteEducationPAPayExtensions
.CreateFlurlRequest(request, HttpMethod.Get, "edu-papay", "contracts", "id", request.ContractId)
.SetQueryParam("appid", request.AppId);

if (request.SubMerchantId is not null)
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);

if (request.SubAppId is not null)
flurlReq.SetQueryParam("sub_appid", request.SubAppId);

return await client.SendFlurlRequestAsJsonAsync<Models.GetEducationPAPayContractByContractIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}

/// <summary>
/// <para>异步调用 [GET] /edu-papay/user/{openid}/contracts 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/wiki/doc/apiv3/Offline/apis/chapter5_2_3.shtml ]]>
/// <![CDATA[ https://pay.weixin.qq.com/docs/merchant/apis/education-fee-payment/contracts/list-user-contracts.html ]]> <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/education-fee-payment/contracts/list-user-contracts.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
Expand All @@ -74,6 +83,15 @@ public static class WechatTenpayClientExecuteEducationPAPayExtensions
.SetQueryParam("appid", request.AppId)
.SetQueryParam("plan_id", request.PlanId);

if (request.SubMerchantId is not null)
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);

if (request.SubAppId is not null)
flurlReq.SetQueryParam("sub_appid", request.SubAppId);

if (request.SubOpenId is not null)
flurlReq.SetQueryParam("sub_openid", request.SubOpenId);

if (request.ContractStatus is not null)
flurlReq.SetQueryParam("contract_status", request.ContractStatus);

Expand All @@ -90,7 +108,8 @@ public static class WechatTenpayClientExecuteEducationPAPayExtensions
/// <para>异步调用 [DELETE] /edu-papay/contracts/{contract_id} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/wiki/doc/apiv3/Offline/apis/chapter5_2_4.shtml ]]>
/// <![CDATA[ https://pay.weixin.qq.com/docs/merchant/apis/education-fee-payment/contracts/delete-contract.html ]]> <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/education-fee-payment/contracts/list-user-contracts.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
Expand All @@ -112,7 +131,8 @@ public static class WechatTenpayClientExecuteEducationPAPayExtensions
/// <para>异步调用 [POST] /edu-papay/user-notifications/{contract_id}/send 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/wiki/doc/apiv3/Offline/apis/chapter5_2_6.shtml ]]>
/// <![CDATA[ https://pay.weixin.qq.com/docs/merchant/apis/education-fee-payment/user-notifications/send-user-notification.html ]]> <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/education-fee-payment/user-notifications/send-user-notification.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
Expand All @@ -134,7 +154,8 @@ public static class WechatTenpayClientExecuteEducationPAPayExtensions
/// <para>异步调用 [POST] /edu-papay/transactions 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/wiki/doc/apiv3/Offline/apis/chapter5_2_7.shtml ]]>
/// <![CDATA[ https://pay.weixin.qq.com/docs/merchant/apis/education-fee-payment/transactions/create-transaction.html ]]> <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/education-fee-payment/transactions/create-transaction.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
Expand All @@ -156,7 +177,8 @@ public static class WechatTenpayClientExecuteEducationPAPayExtensions
/// <para>异步调用 [GET] /edu-papay/transactions/out-trade-no/{out_trade_no} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/wiki/doc/apiv3/Offline/apis/chapter5_2_9.shtml ]]>
/// <![CDATA[ https://pay.weixin.qq.com/docs/merchant/apis/education-fee-payment/transactions/query-transaction-by-out-trade-no.html ]]> <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/education-fee-payment/transactions/query-transaction-by-out-trade-no.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
Expand All @@ -178,7 +200,8 @@ public static class WechatTenpayClientExecuteEducationPAPayExtensions
/// <para>异步调用 [GET] /edu-papay/transactions/id/{transaction_id} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/wiki/doc/apiv3/Offline/apis/chapter5_2_8.shtml ]]>
/// <![CDATA[ https://pay.weixin.qq.com/docs/merchant/apis/education-fee-payment/transactions/query-transaction-by-id.html ]]> <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/education-fee-payment/transactions/query-transaction-by-id.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,27 @@ public class Device
}
}

/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string? SubMerchantId { get; set; }

/// <summary>
/// 获取或设置微信 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
public string AppId { get; set; } = string.Empty;

/// <summary>
/// 获取或设置子商户 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_appid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_appid")]
public string? SubAppId { get; set; }

/// <summary>
/// 获取或设置签约协议号。
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,27 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// </summary>
public class GetEducationPAPayContractByContractIdRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? SubMerchantId { get; set; }

/// <summary>
/// 获取或设置微信 AppId。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string AppId { get; set; } = string.Empty;

/// <summary>
/// 获取或设置子商户 AppId。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? SubAppId { get; set; }

/// <summary>
/// 获取或设置签约协议号。
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,34 @@ public class Contract
}
}

/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string MerchantId { get; set; } = default!;

/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string? SubMerchantId { get; set; }

/// <summary>
/// 获取或设置微信 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
public string AppId { get; set; } = default!;

/// <summary>
/// 获取或设置子商户 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_appid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_appid")]
public string? SubAppId { get; set; }

/// <summary>
/// 获取或设置模板 ID。
/// </summary>
Expand All @@ -57,6 +78,13 @@ public class Contract
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = default!;

/// <summary>
/// 获取或设置用户在子商户下的唯一标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_openid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_openid")]
public string SubOpenId { get; set; } = default!;

/// <summary>
/// 获取或设置签约信息。
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ public static class Types
{
public class Payer : GetPayTransactionByOutTradeNumberResponse.Types.Payer
{
/// <summary>
/// 获取或设置用户在子商户下的唯一标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_openid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_openid")]
public string SubOpenId { get; set; } = default!;
}

public class Amount
Expand Down Expand Up @@ -135,13 +141,34 @@ public class Promotion
}
}

/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string MerchantId { get; set; } = default!;

/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string? SubMerchantId { get; set; }

/// <summary>
/// 获取或设置微信 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
public string AppId { get; set; } = default!;

/// <summary>
/// 获取或设置子商户 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_appid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_appid")]
public string? SubAppId { get; set; }

/// <summary>
/// 获取或设置商户订单号。
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,27 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// </summary>
public class PresignEducationPAPayContractRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string? SubMerchantId { get; set; }

/// <summary>
/// 获取或设置微信 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
public string AppId { get; set; } = string.Empty;

/// <summary>
/// 获取或设置子商户 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_appid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_appid")]
public string? SubAppId { get; set; }

/// <summary>
/// 获取或设置模板 ID。
/// </summary>
Expand All @@ -26,6 +40,13 @@ public class PresignEducationPAPayContractRequest : WechatTenpayRequest
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = string.Empty;

/// <summary>
/// 获取或设置用户在子商户下的唯一标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_openid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_openid")]
public string? SubOpenId { get; set; }

/// <summary>
/// 获取或设置商户用户账号标识。
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,27 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
/// </summary>
public class QueryEducationPAPayUserContractsRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? SubMerchantId { get; set; }

/// <summary>
/// 获取或设置微信 AppId。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string AppId { get; set; } = string.Empty;

/// <summary>
/// 获取或设置子商户 AppId。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? SubAppId { get; set; }

/// <summary>
/// 获取或设置模板 ID。
/// </summary>
Expand All @@ -26,6 +40,13 @@ public class QueryEducationPAPayUserContractsRequest : WechatTenpayRequest
[System.Text.Json.Serialization.JsonIgnore]
public string OpenId { get; set; } = string.Empty;

/// <summary>
/// 获取或设置用户在子商户下的唯一标识。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? SubOpenId { get; set; }

/// <summary>
/// 获取或设置签约状态。
/// </summary>
Expand Down
Loading

0 comments on commit 31ba9c3

Please sign in to comment.