mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 01:58:14 +08:00
feat(tenpayv3): 新增微信支付分服务商场景中预授权接口
This commit is contained in:
@@ -757,6 +757,8 @@
|
|||||||
|
|
||||||
- 商户预授权:`ApplyPayScorePartnerPermissions`
|
- 商户预授权:`ApplyPayScorePartnerPermissions`
|
||||||
|
|
||||||
|
- 场景中预授权:`ApplyPayScorePartnerPermissionsForScene`
|
||||||
|
|
||||||
- 查询用户授权记录(授权协议号):`GetPayScorePartnerPermissionsByAuthorizationCode`
|
- 查询用户授权记录(授权协议号):`GetPayScorePartnerPermissionsByAuthorizationCode`
|
||||||
|
|
||||||
- 解除用户授权关系(授权协议号):`TerminatePayScorePartnerPermissionsByAuthorizationCode`
|
- 解除用户授权关系(授权协议号):`TerminatePayScorePartnerPermissionsByAuthorizationCode`
|
||||||
|
@@ -32,6 +32,28 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
|||||||
return await client.SendFlurlRequestAsJsonAsync<Models.ApplyPayScorePartnerPermissionsResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
return await client.SendFlurlRequestAsJsonAsync<Models.ApplyPayScorePartnerPermissionsResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /payscore/partner/permissions/apply-for-scene 接口。</para>
|
||||||
|
/// <para>
|
||||||
|
/// REF: <br/>
|
||||||
|
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/partner-weixin-pay-score/partner-service-auth/scene-apply-partner-permissions.html ]]>
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.ApplyPayScorePartnerPermissionsForSceneResponse> ExecuteApplyPayScorePartnerPermissionsForSceneAsync(this WechatTenpayClient client, Models.ApplyPayScorePartnerPermissionsForSceneRequest 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, "payscore", "partner", "permissions", "apply-for-scene");
|
||||||
|
|
||||||
|
return await client.SendFlurlRequestAsJsonAsync<Models.ApplyPayScorePartnerPermissionsForSceneResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>异步调用 [GET] /payscore/partner/permissions/authorization-code/{authorization_code} 接口。</para>
|
/// <para>异步调用 [GET] /payscore/partner/permissions/authorization-code/{authorization_code} 接口。</para>
|
||||||
/// <para>
|
/// <para>
|
||||||
|
@@ -0,0 +1,42 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /payscore/partner/permissions/apply-for-scene 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class ApplyPayScorePartnerPermissionsForSceneRequest : ApplyPayScorePartnerPermissionsRequest
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class TransactionSceneInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置微信商户号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||||
|
public string MerchantId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置子商户号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||||
|
public string SubMerchantId { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置授权场景。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("scene")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("scene")]
|
||||||
|
public string Scene { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置微信支付交易中授权附带的参数信息。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("transaction_scene_info")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("transaction_scene_info")]
|
||||||
|
public Types.TransactionSceneInfo? TransactionSceneInfo { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,22 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /payscore/partner/permissions/apply-for-scene 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class ApplyPayScorePartnerPermissionsForSceneResponse : WechatTenpayResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置授权场景。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("scene")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("scene")]
|
||||||
|
public string Scene { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置微信支付交易中授权 Token。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("transaction_permissions_token")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("transaction_permissions_token")]
|
||||||
|
public string? TransactionPermissionsToken { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"service_id": "500001",
|
||||||
|
"appid": "wxd678efh567hg6787",
|
||||||
|
"sub_appid": "wxd678efh567hg6787",
|
||||||
|
"sub_mchid": "1230000109",
|
||||||
|
"authorization_code": "实例1234323JKHDFE1243252",
|
||||||
|
"notify_url": "http://www.qq.com",
|
||||||
|
"scene": "TRANSACTION",
|
||||||
|
"transaction_scene_info": {
|
||||||
|
"mchid": "1230000109",
|
||||||
|
"sub_mchid": "1230000109"
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"scene": "TRANSACTION",
|
||||||
|
"transaction_permissions_token": "transaction_permissions_token"
|
||||||
|
}
|
Reference in New Issue
Block a user