mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-18 17:48:12 +08:00
feat(tenpayv3): 新增微信支付分停车服务相关接口
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 VEHICLE.ENTRANCE_STATE_CHANGE 通知的数据。</para>
|
||||
/// </summary>
|
||||
public class VehicleEntranceStateChangeResource : WechatTenpayEvent.Types.IDecryptedResource
|
||||
{
|
||||
/// <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>
|
||||
/// 获取或设置商户入场 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_parking_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_parking_no")]
|
||||
public string OutParkingId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置停车入场 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parking_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parking_id")]
|
||||
public string ParkingId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("plate_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("plate_number")]
|
||||
public string PlateNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌颜色。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("plate_color")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("plate_color")]
|
||||
public string PlateColor { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置入场时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("start_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置停车场名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parking_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parking_name")]
|
||||
public string ParkingName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置免费时长(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("free_duration")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("free_duration")]
|
||||
public int FreeDuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置停车入场状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parking_state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parking_state")]
|
||||
public string ParkingState { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置不可用原因。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("blocked_state_description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("blocked_state_description")]
|
||||
public string? BlockReason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置状态变更时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("state_update_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("state_update_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset ParkingStateUpdateTime { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,182 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 TRANSACTION.SUCCESS(仅限微信支付分停车服务)通知的数据。</para>
|
||||
/// <para>表示 TRANSACTION.FAIL(仅限微信支付分停车服务)通知的数据。</para>
|
||||
/// <para>表示 TRANSACTION.PAY_BACK(仅限微信支付分停车服务)通知的数据。</para>
|
||||
/// </summary>
|
||||
public class VehicleTransactionResource : WechatTenpayEvent.Types.IDecryptedResource
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Payer : Models.GetVehicleTransactionByOutTradeNumberResponse.Types.Payer
|
||||
{
|
||||
}
|
||||
|
||||
public class Amount : Models.GetVehicleTransactionByOutTradeNumberResponse.Types.Amount
|
||||
{
|
||||
}
|
||||
|
||||
public class Parking : Models.GetVehicleTransactionByOutTradeNumberResponse.Types.Parking
|
||||
{
|
||||
}
|
||||
|
||||
public class Promotion : Models.GetVehicleTransactionByOutTradeNumberResponse.Types.Promotion
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
internal static class Converters
|
||||
{
|
||||
internal class NewtonsoftJsonYesOrNoConverter : Models.CreateVehicleTransactionParkingRequest.Converters.NewtonsoftJsonYesOrNoConverter
|
||||
{
|
||||
}
|
||||
|
||||
internal class SystemTextJsonYesOrNoConverter : Models.CreateVehicleTransactionParkingRequest.Converters.SystemTextJsonYesOrNoConverter
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <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>
|
||||
[Newtonsoft.Json.JsonProperty("description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("description")]
|
||||
public string Description { 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_state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_state")]
|
||||
public string TradeState { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置交易状态描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trade_state_description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_state_description")]
|
||||
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("user_repaid")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Converters.NewtonsoftJsonYesOrNoConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user_repaid")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(Converters.SystemTextJsonYesOrNoConverter))]
|
||||
public bool? IsUserRepaid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置交易场景。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trade_scene")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_scene")]
|
||||
public string TradeScene { 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("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("parking_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parking_info")]
|
||||
public Types.Parking? Parking { 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,107 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
{
|
||||
/// <summary>
|
||||
/// 为 <see cref="WechatTenpayClient"/> 提供商户微信支付分停车服务相关的 API 扩展方法。
|
||||
/// </summary>
|
||||
public static class WechatTenpayClientExecuteVehicleExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /vehicle/parking/services/find 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter8_8_1.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter8_8_1.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetVehicleParkingServiceResponse> ExecuteGetVehicleParkingServiceAsync(this WechatTenpayClient client, Models.GetVehicleParkingServiceRequest 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, "vehicle", "parking", "services", "find")
|
||||
.SetQueryParam("appid", request.AppId)
|
||||
.SetQueryParam("plate_number", request.PlateNumber)
|
||||
.SetQueryParam("plate_color", request.PlateColor)
|
||||
.SetQueryParam("openid", request.OpenId);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SubMerchantId))
|
||||
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetVehicleParkingServiceResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /vehicle/parking/parkings 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter8_8_2.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter8_8_2.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateVehicleParkingResponse> ExecuteCreateVehicleParkingAsync(this WechatTenpayClient client, Models.CreateVehicleParkingRequest 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, "vehicle", "parking", "parkings");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateVehicleParkingResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /vehicle/transactions/parking 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter8_8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter8_8_3.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateVehicleTransactionParkingResponse> ExecuteCreateVehicleTransactionParkingAsync(this WechatTenpayClient client, Models.CreateVehicleTransactionParkingRequest 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, "vehicle", "transactions", "parking");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateVehicleTransactionParkingResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /vehicle/transactions/out-trade-no/{out_trade_no} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter8_8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter8_8_4.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetVehicleTransactionByOutTradeNumberResponse> ExecuteGetVehicleTransactionByOutTradeNumberAsync(this WechatTenpayClient client, Models.GetVehicleTransactionByOutTradeNumberRequest 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, "vehicle", "transactions", "out-trade-no", request.OutTradeNumber);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.SubMerchantId))
|
||||
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetVehicleTransactionByOutTradeNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@@ -8,5 +8,11 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
/// </summary>
|
||||
public class CreateBrandProfitSharingOrderResponse : GetBrandProfitSharingOrderByOutOrderNumberResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置品牌主商户号 。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("brand_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("brand_mchid")]
|
||||
public string BrandMerchantId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
public class GetMarketingBusifavorCallbackResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商户号。
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
|
@@ -9,7 +9,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
public class UpdateMarketingBusifavorCallbackResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商户号。
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
|
@@ -13,7 +13,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
public class InvalidMerchant
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商户号。
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
|
@@ -13,7 +13,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
public class Merchant
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商户号。
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
|
@@ -109,7 +109,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("coupon_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("coupon_id")]
|
||||
public string Id { get; set; } = default!;
|
||||
public string CouponId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠名称。
|
||||
|
@@ -29,6 +29,6 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
[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; } = default!;
|
||||
public DateTimeOffset CreateTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /vehicle/parking/parkings 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreateVehicleParkingRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string? SubMerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户入场 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_parking_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_parking_no")]
|
||||
public string OutParkingNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("plate_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("plate_number")]
|
||||
public string PlateNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌颜色。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("plate_color")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("plate_color")]
|
||||
public string PlateColor { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置回调通知地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("notify_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("notify_url")]
|
||||
public string? NotifyUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置入场时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("start_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置停车场名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parking_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parking_name")]
|
||||
public string ParkingName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置免费时长(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("free_duration")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("free_duration")]
|
||||
public int FreeDuration { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /vehicle/parking/parkings 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreateVehicleParkingResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置停车入场 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public string ParkingId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户入场 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_parking_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_parking_no")]
|
||||
public string OutParkingNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("plate_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("plate_number")]
|
||||
public string PlateNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌颜色。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("plate_color")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("plate_color")]
|
||||
public string PlateColor { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置入场时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("start_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置停车场名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parking_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parking_name")]
|
||||
public string ParkingName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置免费时长(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("free_duration")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("free_duration")]
|
||||
public int FreeDuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置停车入场状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("state")]
|
||||
public string State { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置不可用原因。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("block_reason")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("block_reason")]
|
||||
public string? BlockReason { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /vehicle/parking/services/find 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetVehicleParkingServiceRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? SubMerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string PlateNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌颜色。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string PlateColor { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户的 OpenId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string OpenId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /vehicle/parking/services/find 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetVehicleParkingServiceResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置车牌号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("plate_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("plate_number")]
|
||||
public string PlateNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌颜色。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("plate_color")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("plate_color")]
|
||||
public string PlateColor { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户的 OpenId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置服务状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("service_state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("service_state")]
|
||||
public string ServiceState { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置服务开通时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("service_open_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("service_open_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
public DateTimeOffset? ServiceOpenTime { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,270 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /vehicle/transactions/parking 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreateVehicleTransactionParkingRequest : WechatTenpayRequest
|
||||
{
|
||||
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 Parking
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置停车入场 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parking_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parking_id")]
|
||||
public string ParkingId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("plate_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("plate_number")]
|
||||
public string PlateNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌颜色。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("plate_color")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("plate_color")]
|
||||
public string PlateColor { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置入场时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("start_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置出场时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("end_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("end_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置停车场名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parking_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parking_name")]
|
||||
public string ParkingName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置计费时长(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("charging_duration")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("charging_duration")]
|
||||
public int ChargingDuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置停车场设备 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("device_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("device_id")]
|
||||
public string? DeviceId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
internal static class Converters
|
||||
{
|
||||
internal class NewtonsoftJsonYesOrNoConverter : Newtonsoft.Json.JsonConverter<bool?>
|
||||
{
|
||||
public override bool CanRead
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanWrite
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool? ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, bool? existingValue, bool hasExistingValue, Newtonsoft.Json.JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == Newtonsoft.Json.JsonToken.Null)
|
||||
{
|
||||
return existingValue;
|
||||
}
|
||||
else if (reader.TokenType == Newtonsoft.Json.JsonToken.Boolean)
|
||||
{
|
||||
return serializer.Deserialize<bool>(reader);
|
||||
}
|
||||
else if (reader.TokenType == Newtonsoft.Json.JsonToken.String)
|
||||
{
|
||||
string? value = serializer.Deserialize<string>(reader);
|
||||
if (value == null)
|
||||
return existingValue;
|
||||
|
||||
if ("Y".Equals(value))
|
||||
return true;
|
||||
else if ("N".Equals(value))
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new Newtonsoft.Json.JsonReaderException();
|
||||
}
|
||||
|
||||
public override void WriteJson(Newtonsoft.Json.JsonWriter writer, bool? value, Newtonsoft.Json.JsonSerializer serializer)
|
||||
{
|
||||
if (value.HasValue)
|
||||
writer.WriteValue(value.Value ? "Y" : "N");
|
||||
else
|
||||
writer.WriteNull();
|
||||
}
|
||||
}
|
||||
|
||||
internal class SystemTextJsonYesOrNoConverter : System.Text.Json.Serialization.JsonConverter<bool?>
|
||||
{
|
||||
public override bool? Read(ref System.Text.Json.Utf8JsonReader reader, Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
|
||||
{
|
||||
if (reader.TokenType == System.Text.Json.JsonTokenType.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (reader.TokenType == System.Text.Json.JsonTokenType.True)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (reader.TokenType == System.Text.Json.JsonTokenType.False)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (reader.TokenType == System.Text.Json.JsonTokenType.String)
|
||||
{
|
||||
string? value = reader.GetString();
|
||||
if (value == null)
|
||||
return null;
|
||||
|
||||
if ("Y".Equals(value))
|
||||
return true;
|
||||
else if ("N".Equals(value))
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new System.Text.Json.JsonException();
|
||||
}
|
||||
|
||||
public override void Write(System.Text.Json.Utf8JsonWriter writer, bool? value, System.Text.Json.JsonSerializerOptions options)
|
||||
{
|
||||
if (value.HasValue)
|
||||
writer.WriteStringValue(value.Value ? "Y" : "N");
|
||||
else
|
||||
writer.WriteNullValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <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>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string? SubMerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置服务描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("description")]
|
||||
public string Description { 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("attach")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("attach")]
|
||||
public string? Attachment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置交易场景。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trade_scene")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_scene")]
|
||||
public string TradeScene { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置回调通知地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("notify_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("notify_url")]
|
||||
public string? NotifyUrl { 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("profit_sharing")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Converters.NewtonsoftJsonYesOrNoConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("profit_sharing")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(Converters.SystemTextJsonYesOrNoConverter))]
|
||||
public bool? IsProfitSharing { 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("parking_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parking_info")]
|
||||
public Types.Parking Parking { get; set; } = new Types.Parking();
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /vehicle/transactions/parking 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreateVehicleTransactionParkingResponse : GetVehicleTransactionByOutTradeNumberResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /vehicle/transactions/out-trade-no/{out_trade_no} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetVehicleTransactionByOutTradeNumberRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? SubMerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string OutTradeNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,348 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /vehicle/transactions/out-trade-no/{out_trade_no} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetVehicleTransactionByOutTradeNumberResponse : WechatTenpayResponse
|
||||
{
|
||||
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!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户在子商户下唯一标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_openid")]
|
||||
public string? SubOpenId { get; set; }
|
||||
}
|
||||
|
||||
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("discount_total")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("discount_total")]
|
||||
public int? DiscountTotal { get; set; }
|
||||
}
|
||||
|
||||
public class Parking
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置停车入场 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parking_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parking_id")]
|
||||
public string ParkingId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("plate_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("plate_number")]
|
||||
public string PlateNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置车牌颜色。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("plate_color")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("plate_color")]
|
||||
public string PlateColor { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置入场时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("start_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置出场时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("end_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("end_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置停车场名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("parking_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parking_name")]
|
||||
public string ParkingName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置计费时长(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("charging_duration")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("charging_duration")]
|
||||
public int ChargingDuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置停车场设备 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("device_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("device_id")]
|
||||
public string? DeviceId { get; set; }
|
||||
}
|
||||
|
||||
public class Promotion
|
||||
{
|
||||
/// <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; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string? Type { get; set; }
|
||||
|
||||
/// <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; }
|
||||
}
|
||||
}
|
||||
|
||||
internal static class Converters
|
||||
{
|
||||
internal class NewtonsoftJsonYesOrNoConverter : CreateVehicleTransactionParkingRequest.Converters.NewtonsoftJsonYesOrNoConverter
|
||||
{
|
||||
}
|
||||
|
||||
internal class SystemTextJsonYesOrNoConverter : CreateVehicleTransactionParkingRequest.Converters.SystemTextJsonYesOrNoConverter
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <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>
|
||||
[Newtonsoft.Json.JsonProperty("description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("description")]
|
||||
public string Description { 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_state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_state")]
|
||||
public string TradeState { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置交易状态描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trade_state_description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_state_description")]
|
||||
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("user_repaid")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Converters.NewtonsoftJsonYesOrNoConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user_repaid")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(Converters.SystemTextJsonYesOrNoConverter))]
|
||||
public bool? IsUserRepaid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置交易场景。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trade_scene")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_scene")]
|
||||
public string TradeScene { 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("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("parking_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("parking_info")]
|
||||
public Types.Parking? Parking { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("promotion_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("promotion_detail")]
|
||||
public Types.Promotion[]? PromotionList { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user