mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 23:13:32 +08:00
feat(wxapi): 新增小程序自定义交易组件拉取小程序信息接口
This commit is contained in:
parent
8a67fc3d58
commit
1b5ca083df
@ -1424,6 +1424,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ShopWxpayGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /shop/wxpay/get_info 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/wxpay/get_info.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ShopWxpayGetInfoResponse> ExecuteShopWxpayGetInfoAsync(this WechatApiClient client, Models.ShopWxpayGetInfoRequest 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, "shop", "wxpay", "get_info")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ShopWxpayGetInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Funds
|
||||
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /shop/wxpay/get_info 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ShopWxpayGetInfoRequest : WechatApiRequest, IInferable<ShopWxpayGetInfoRequest, ShopWxpayGetInfoResponse>
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /shop/wxpay/get_info 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ShopWxpayGetInfoResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class PayRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class BusinessLicense
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商户名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_name")]
|
||||
public string MerchantName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置营业执照编号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_license_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_license_number")]
|
||||
public string BusinessLicenseNumber { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class Contact
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置联系人姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人身份证号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_id_card_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_id_card_number")]
|
||||
public string IdCardNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置手机号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mobile_phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mobile_phone")]
|
||||
public string MobileNumber { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class SaleScene
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置店铺名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_name")]
|
||||
public string? StoreName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置店铺链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_url")]
|
||||
public string? StoreUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户小程序 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mini_program_sub_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mini_program_sub_appid")]
|
||||
public string? MiniProgramSubAppId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置主体类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("organization_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("organization_type")]
|
||||
public int SubjectType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置营业执照信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_license_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_license_info")]
|
||||
public Types.BusinessLicense BusinessLicense { get; set; } = new Types.BusinessLicense();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_info")]
|
||||
public Types.Contact Contact { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户简称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_shortname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_shortname")]
|
||||
public string? MerchantShortName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置销售场景信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sales_scene_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sales_scene_info")]
|
||||
public Types.SaleScene? SaleScene { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置进件信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pay_req")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pay_req")]
|
||||
public Types.PayRequest PayRequest { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -159,7 +159,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_name")]
|
||||
public string StoreName { get; set; } = default!;
|
||||
public string? StoreName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置店铺链接。
|
||||
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"pay_req": {
|
||||
"organization_type": "2",
|
||||
"business_license_info": {
|
||||
"business_license_number": "32784238MA5CN4WK0D",
|
||||
"merchant_name": "魅力广州"
|
||||
},
|
||||
"contact_info": {
|
||||
"contact_name": "**海",
|
||||
"contact_id_card_number": "43***************1",
|
||||
"mobile_phone": "186******02"
|
||||
},
|
||||
"sales_scene_info": {
|
||||
"store_name": "魅力广州A",
|
||||
"mini_program_sub_appid": "wx50808a0fa3b8abca"
|
||||
},
|
||||
"merchant_shortname": "魅力广州"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user