using System.Text.Json.Serialization;

namespace HoneyBox.Model.Models.Payment;

#region V3 JSAPI 下单请求/响应模型

/// <summary>
/// V3 JSAPI 下单请求
/// </summary>
public class WechatPayV3JsapiRequest
{
    /// <summary>
    /// 应用ID
    /// </summary>
    [JsonPropertyName("appid")]
    public string AppId { get; set; } = string.Empty;

    /// <summary>
    /// 商户号
    /// </summary>
    [JsonPropertyName("mchid")]
    public string MchId { get; set; } = string.Empty;

    /// <summary>
    /// 商品描述
    /// </summary>
    [JsonPropertyName("description")]
    public string Description { get; set; } = string.Empty;

    /// <summary>
    /// 商户订单号
    /// </summary>
    [JsonPropertyName("out_trade_no")]
    public string OutTradeNo { get; set; } = string.Empty;

    /// <summary>
    /// 通知地址
    /// </summary>
    [JsonPropertyName("notify_url")]
    public string NotifyUrl { get; set; } = string.Empty;

    /// <summary>
    /// 订单金额信息
    /// </summary>
    [JsonPropertyName("amount")]
    public WechatPayV3Amount Amount { get; set; } = new();

    /// <summary>
    /// 支付者信息
    /// </summary>
    [JsonPropertyName("payer")]
    public WechatPayV3Payer Payer { get; set; } = new();

    /// <summary>
    /// 附加数据（可选）
    /// </summary>
    [JsonPropertyName("attach")]
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public string? Attach { get; set; }

    /// <summary>
    /// 交易结束时间（可选，RFC3339格式）
    /// </summary>
    [JsonPropertyName("time_expire")]
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public string? TimeExpire { get; set; }
}

/// <summary>
/// V3 金额信息
/// </summary>
public class WechatPayV3Amount
{
    /// <summary>
    /// 总金额（单位：分）
    /// </summary>
    [JsonPropertyName("total")]
    public int Total { get; set; }

    /// <summary>
    /// 货币类型（默认：CNY）
    /// </summary>
    [JsonPropertyName("currency")]
    public string Currency { get; set; } = "CNY";
}

/// <summary>
/// V3 支付者信息
/// </summary>
public class WechatPayV3Payer
{
    /// <summary>
    /// 用户标识（OpenId）
    /// </summary>
    [JsonPropertyName("openid")]
    public string OpenId { get; set; } = string.Empty;
}

/// <summary>
/// V3 JSAPI 下单响应
/// </summary>
public class WechatPayV3JsapiResponse
{
    /// <summary>
    /// 预支付交易会话标识
    /// </summary>
    [JsonPropertyName("prepay_id")]
    public string PrepayId { get; set; } = string.Empty;
}

#endregion


#region V3 回调通知模型

/// <summary>
/// V3 回调通知
/// </summary>
public class WechatPayV3Notification
{
    /// <summary>
    /// 通知ID
    /// </summary>
    [JsonPropertyName("id")]
    public string Id { get; set; } = string.Empty;

    /// <summary>
    /// 通知创建时间（RFC3339格式）
    /// </summary>
    [JsonPropertyName("create_time")]
    public string CreateTime { get; set; } = string.Empty;

    /// <summary>
    /// 通知类型（如：TRANSACTION.SUCCESS）
    /// </summary>
    [JsonPropertyName("event_type")]
    public string EventType { get; set; } = string.Empty;

    /// <summary>
    /// 通知数据类型
    /// </summary>
    [JsonPropertyName("resource_type")]
    public string ResourceType { get; set; } = string.Empty;

    /// <summary>
    /// 通知资源数据（加密数据）
    /// </summary>
    [JsonPropertyName("resource")]
    public WechatPayV3Resource Resource { get; set; } = new();

    /// <summary>
    /// 回调摘要
    /// </summary>
    [JsonPropertyName("summary")]
    public string Summary { get; set; } = string.Empty;
}

/// <summary>
/// V3 回调资源（加密数据）
/// </summary>
public class WechatPayV3Resource
{
    /// <summary>
    /// 加密算法类型（AEAD_AES_256_GCM）
    /// </summary>
    [JsonPropertyName("algorithm")]
    public string Algorithm { get; set; } = string.Empty;

    /// <summary>
    /// 数据密文（Base64编码）
    /// </summary>
    [JsonPropertyName("ciphertext")]
    public string Ciphertext { get; set; } = string.Empty;

    /// <summary>
    /// 随机串
    /// </summary>
    [JsonPropertyName("nonce")]
    public string Nonce { get; set; } = string.Empty;

    /// <summary>
    /// 附加数据
    /// </summary>
    [JsonPropertyName("associated_data")]
    public string AssociatedData { get; set; } = string.Empty;

    /// <summary>
    /// 原始类型
    /// </summary>
    [JsonPropertyName("original_type")]
    public string OriginalType { get; set; } = string.Empty;
}

/// <summary>
/// V3 解密后的支付结果
/// </summary>
public class WechatPayV3PaymentResult
{
    /// <summary>
    /// 应用ID
    /// </summary>
    [JsonPropertyName("appid")]
    public string AppId { get; set; } = string.Empty;

    /// <summary>
    /// 商户号
    /// </summary>
    [JsonPropertyName("mchid")]
    public string MchId { get; set; } = string.Empty;

    /// <summary>
    /// 商户订单号
    /// </summary>
    [JsonPropertyName("out_trade_no")]
    public string OutTradeNo { get; set; } = string.Empty;

    /// <summary>
    /// 微信支付订单号
    /// </summary>
    [JsonPropertyName("transaction_id")]
    public string TransactionId { get; set; } = string.Empty;

    /// <summary>
    /// 交易类型（JSAPI、NATIVE、APP等）
    /// </summary>
    [JsonPropertyName("trade_type")]
    public string TradeType { get; set; } = string.Empty;

    /// <summary>
    /// 交易状态（SUCCESS、NOTPAY、CLOSED等）
    /// </summary>
    [JsonPropertyName("trade_state")]
    public string TradeState { get; set; } = string.Empty;

    /// <summary>
    /// 交易状态描述
    /// </summary>
    [JsonPropertyName("trade_state_desc")]
    public string TradeStateDesc { get; set; } = string.Empty;

    /// <summary>
    /// 付款银行
    /// </summary>
    [JsonPropertyName("bank_type")]
    public string BankType { get; set; } = string.Empty;

    /// <summary>
    /// 支付完成时间（RFC3339格式）
    /// </summary>
    [JsonPropertyName("success_time")]
    public string SuccessTime { get; set; } = string.Empty;

    /// <summary>
    /// 支付者信息
    /// </summary>
    [JsonPropertyName("payer")]
    public WechatPayV3Payer Payer { get; set; } = new();

    /// <summary>
    /// 订单金额信息
    /// </summary>
    [JsonPropertyName("amount")]
    public WechatPayV3PaymentAmount Amount { get; set; } = new();

    /// <summary>
    /// 附加数据
    /// </summary>
    [JsonPropertyName("attach")]
    public string Attach { get; set; } = string.Empty;
}

/// <summary>
/// V3 支付金额（回调）
/// </summary>
public class WechatPayV3PaymentAmount
{
    /// <summary>
    /// 订单总金额（单位：分）
    /// </summary>
    [JsonPropertyName("total")]
    public int Total { get; set; }

    /// <summary>
    /// 用户支付金额（单位：分）
    /// </summary>
    [JsonPropertyName("payer_total")]
    public int PayerTotal { get; set; }

    /// <summary>
    /// 货币类型
    /// </summary>
    [JsonPropertyName("currency")]
    public string Currency { get; set; } = "CNY";

    /// <summary>
    /// 用户支付币种
    /// </summary>
    [JsonPropertyName("payer_currency")]
    public string PayerCurrency { get; set; } = "CNY";
}

/// <summary>
/// V3 回调响应（成功）
/// </summary>
public class WechatPayV3NotifyResponse
{
    /// <summary>
    /// 返回状态码（SUCCESS/FAIL）
    /// </summary>
    [JsonPropertyName("code")]
    public string Code { get; set; } = "SUCCESS";

    /// <summary>
    /// 返回信息
    /// </summary>
    [JsonPropertyName("message")]
    public string Message { get; set; } = string.Empty;
}

#endregion


#region V3 订单查询模型

/// <summary>
/// V3 订单查询响应（微信API原始响应）
/// </summary>
public class WechatPayV3QueryResponse
{
    /// <summary>
    /// 应用ID
    /// </summary>
    [JsonPropertyName("appid")]
    public string AppId { get; set; } = string.Empty;

    /// <summary>
    /// 商户号
    /// </summary>
    [JsonPropertyName("mchid")]
    public string MchId { get; set; } = string.Empty;

    /// <summary>
    /// 商户订单号
    /// </summary>
    [JsonPropertyName("out_trade_no")]
    public string OutTradeNo { get; set; } = string.Empty;

    /// <summary>
    /// 微信支付订单号
    /// </summary>
    [JsonPropertyName("transaction_id")]
    public string TransactionId { get; set; } = string.Empty;

    /// <summary>
    /// 交易类型
    /// </summary>
    [JsonPropertyName("trade_type")]
    public string TradeType { get; set; } = string.Empty;

    /// <summary>
    /// 交易状态
    /// </summary>
    [JsonPropertyName("trade_state")]
    public string TradeState { get; set; } = string.Empty;

    /// <summary>
    /// 交易状态描述
    /// </summary>
    [JsonPropertyName("trade_state_desc")]
    public string TradeStateDesc { get; set; } = string.Empty;

    /// <summary>
    /// 付款银行
    /// </summary>
    [JsonPropertyName("bank_type")]
    public string BankType { get; set; } = string.Empty;

    /// <summary>
    /// 支付完成时间
    /// </summary>
    [JsonPropertyName("success_time")]
    public string SuccessTime { get; set; } = string.Empty;

    /// <summary>
    /// 支付者信息
    /// </summary>
    [JsonPropertyName("payer")]
    public WechatPayV3Payer Payer { get; set; } = new();

    /// <summary>
    /// 订单金额信息
    /// </summary>
    [JsonPropertyName("amount")]
    public WechatPayV3PaymentAmount Amount { get; set; } = new();

    /// <summary>
    /// 附加数据
    /// </summary>
    [JsonPropertyName("attach")]
    public string Attach { get; set; } = string.Empty;
}

/// <summary>
/// V3 订单查询结果（业务封装）
/// </summary>
public class WechatPayV3QueryResult
{
    /// <summary>
    /// 是否成功
    /// </summary>
    public bool Success { get; set; }

    /// <summary>
    /// 交易状态（SUCCESS、NOTPAY、CLOSED、USERPAYING、PAYERROR等）
    /// </summary>
    public string TradeState { get; set; } = string.Empty;

    /// <summary>
    /// 交易状态描述
    /// </summary>
    public string TradeStateDesc { get; set; } = string.Empty;

    /// <summary>
    /// 微信支付订单号
    /// </summary>
    public string? TransactionId { get; set; }

    /// <summary>
    /// 商户订单号
    /// </summary>
    public string? OutTradeNo { get; set; }

    /// <summary>
    /// 订单金额（单位：分）
    /// </summary>
    public int? TotalAmount { get; set; }

    /// <summary>
    /// 支付完成时间
    /// </summary>
    public string? SuccessTime { get; set; }

    /// <summary>
    /// 错误码
    /// </summary>
    public string? ErrorCode { get; set; }

    /// <summary>
    /// 错误消息
    /// </summary>
    public string? ErrorMessage { get; set; }
}

#endregion

#region V3 订单关闭模型

/// <summary>
/// V3 订单关闭请求
/// </summary>
public class WechatPayV3CloseRequest
{
    /// <summary>
    /// 商户号
    /// </summary>
    [JsonPropertyName("mchid")]
    public string MchId { get; set; } = string.Empty;
}

/// <summary>
/// V3 订单关闭结果（业务封装）
/// </summary>
public class WechatPayV3CloseResult
{
    /// <summary>
    /// 是否成功（HTTP 204 表示成功）
    /// </summary>
    public bool Success { get; set; }

    /// <summary>
    /// 错误码
    /// </summary>
    public string? ErrorCode { get; set; }

    /// <summary>
    /// 错误消息
    /// </summary>
    public string? ErrorMessage { get; set; }
}

#endregion

#region V3 退款模型

/// <summary>
/// V3 退款请求（业务封装）
/// </summary>
public class WechatPayV3RefundRequest
{
    /// <summary>
    /// 商户订单号（与微信支付订单号二选一）
    /// </summary>
    public string OrderNo { get; set; } = string.Empty;

    /// <summary>
    /// 微信支付订单号（与商户订单号二选一）
    /// </summary>
    public string? TransactionId { get; set; }

    /// <summary>
    /// 商户退款单号
    /// </summary>
    public string RefundNo { get; set; } = string.Empty;

    /// <summary>
    /// 退款原因（可选）
    /// </summary>
    public string? Reason { get; set; }

    /// <summary>
    /// 退款结果回调URL（可选）
    /// </summary>
    public string? NotifyUrl { get; set; }

    /// <summary>
    /// 订单总金额（单位：分）
    /// </summary>
    public int TotalAmount { get; set; }

    /// <summary>
    /// 退款金额（单位：分）
    /// </summary>
    public int RefundAmount { get; set; }
}

/// <summary>
/// V3 退款API请求（微信API格式）
/// </summary>
public class WechatPayV3RefundApiRequest
{
    /// <summary>
    /// 商户订单号
    /// </summary>
    [JsonPropertyName("out_trade_no")]
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public string? OutTradeNo { get; set; }

    /// <summary>
    /// 微信支付订单号
    /// </summary>
    [JsonPropertyName("transaction_id")]
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public string? TransactionId { get; set; }

    /// <summary>
    /// 商户退款单号
    /// </summary>
    [JsonPropertyName("out_refund_no")]
    public string OutRefundNo { get; set; } = string.Empty;

    /// <summary>
    /// 退款原因
    /// </summary>
    [JsonPropertyName("reason")]
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public string? Reason { get; set; }

    /// <summary>
    /// 退款结果回调URL
    /// </summary>
    [JsonPropertyName("notify_url")]
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public string? NotifyUrl { get; set; }

    /// <summary>
    /// 金额信息
    /// </summary>
    [JsonPropertyName("amount")]
    public WechatPayV3RefundAmount Amount { get; set; } = new();
}

/// <summary>
/// V3 退款金额信息
/// </summary>
public class WechatPayV3RefundAmount
{
    /// <summary>
    /// 退款金额（单位：分）
    /// </summary>
    [JsonPropertyName("refund")]
    public int Refund { get; set; }

    /// <summary>
    /// 原订单金额（单位：分）
    /// </summary>
    [JsonPropertyName("total")]
    public int Total { get; set; }

    /// <summary>
    /// 货币类型
    /// </summary>
    [JsonPropertyName("currency")]
    public string Currency { get; set; } = "CNY";
}

/// <summary>
/// V3 退款API响应（微信API格式）
/// </summary>
public class WechatPayV3RefundApiResponse
{
    /// <summary>
    /// 微信支付退款单号
    /// </summary>
    [JsonPropertyName("refund_id")]
    public string RefundId { get; set; } = string.Empty;

    /// <summary>
    /// 商户退款单号
    /// </summary>
    [JsonPropertyName("out_refund_no")]
    public string OutRefundNo { get; set; } = string.Empty;

    /// <summary>
    /// 微信支付订单号
    /// </summary>
    [JsonPropertyName("transaction_id")]
    public string TransactionId { get; set; } = string.Empty;

    /// <summary>
    /// 商户订单号
    /// </summary>
    [JsonPropertyName("out_trade_no")]
    public string OutTradeNo { get; set; } = string.Empty;

    /// <summary>
    /// 退款渠道
    /// </summary>
    [JsonPropertyName("channel")]
    public string Channel { get; set; } = string.Empty;

    /// <summary>
    /// 退款入账账户
    /// </summary>
    [JsonPropertyName("user_received_account")]
    public string UserReceivedAccount { get; set; } = string.Empty;

    /// <summary>
    /// 退款创建时间
    /// </summary>
    [JsonPropertyName("create_time")]
    public string CreateTime { get; set; } = string.Empty;

    /// <summary>
    /// 退款状态（SUCCESS、CLOSED、PROCESSING、ABNORMAL）
    /// </summary>
    [JsonPropertyName("status")]
    public string Status { get; set; } = string.Empty;

    /// <summary>
    /// 金额信息
    /// </summary>
    [JsonPropertyName("amount")]
    public WechatPayV3RefundResponseAmount Amount { get; set; } = new();
}

/// <summary>
/// V3 退款响应金额信息
/// </summary>
public class WechatPayV3RefundResponseAmount
{
    /// <summary>
    /// 订单金额（单位：分）
    /// </summary>
    [JsonPropertyName("total")]
    public int Total { get; set; }

    /// <summary>
    /// 退款金额（单位：分）
    /// </summary>
    [JsonPropertyName("refund")]
    public int Refund { get; set; }

    /// <summary>
    /// 用户支付金额（单位：分）
    /// </summary>
    [JsonPropertyName("payer_total")]
    public int PayerTotal { get; set; }

    /// <summary>
    /// 用户退款金额（单位：分）
    /// </summary>
    [JsonPropertyName("payer_refund")]
    public int PayerRefund { get; set; }

    /// <summary>
    /// 货币类型
    /// </summary>
    [JsonPropertyName("currency")]
    public string Currency { get; set; } = "CNY";
}

/// <summary>
/// V3 退款结果（业务封装）
/// </summary>
public class WechatPayV3RefundResult
{
    /// <summary>
    /// 是否成功
    /// </summary>
    public bool Success { get; set; }

    /// <summary>
    /// 微信支付退款单号
    /// </summary>
    public string? RefundId { get; set; }

    /// <summary>
    /// 商户退款单号
    /// </summary>
    public string? OutRefundNo { get; set; }

    /// <summary>
    /// 退款状态（SUCCESS、CLOSED、PROCESSING、ABNORMAL）
    /// </summary>
    public string? Status { get; set; }

    /// <summary>
    /// 退款金额（单位：分）
    /// </summary>
    public int? RefundAmount { get; set; }

    /// <summary>
    /// 错误码
    /// </summary>
    public string? ErrorCode { get; set; }

    /// <summary>
    /// 错误消息
    /// </summary>
    public string? ErrorMessage { get; set; }
}

/// <summary>
/// V3 退款回调解密后的结果
/// </summary>
public class WechatPayV3RefundNotifyResult
{
    /// <summary>
    /// 商户号
    /// </summary>
    [JsonPropertyName("mchid")]
    public string MchId { get; set; } = string.Empty;

    /// <summary>
    /// 商户订单号
    /// </summary>
    [JsonPropertyName("out_trade_no")]
    public string OutTradeNo { get; set; } = string.Empty;

    /// <summary>
    /// 微信支付订单号
    /// </summary>
    [JsonPropertyName("transaction_id")]
    public string TransactionId { get; set; } = string.Empty;

    /// <summary>
    /// 商户退款单号
    /// </summary>
    [JsonPropertyName("out_refund_no")]
    public string OutRefundNo { get; set; } = string.Empty;

    /// <summary>
    /// 微信支付退款单号
    /// </summary>
    [JsonPropertyName("refund_id")]
    public string RefundId { get; set; } = string.Empty;

    /// <summary>
    /// 退款状态
    /// </summary>
    [JsonPropertyName("refund_status")]
    public string RefundStatus { get; set; } = string.Empty;

    /// <summary>
    /// 退款成功时间
    /// </summary>
    [JsonPropertyName("success_time")]
    public string SuccessTime { get; set; } = string.Empty;

    /// <summary>
    /// 退款入账账户
    /// </summary>
    [JsonPropertyName("user_received_account")]
    public string UserReceivedAccount { get; set; } = string.Empty;

    /// <summary>
    /// 金额信息
    /// </summary>
    [JsonPropertyName("amount")]
    public WechatPayV3RefundNotifyAmount Amount { get; set; } = new();
}

/// <summary>
/// V3 退款回调金额信息
/// </summary>
public class WechatPayV3RefundNotifyAmount
{
    /// <summary>
    /// 订单金额（单位：分）
    /// </summary>
    [JsonPropertyName("total")]
    public int Total { get; set; }

    /// <summary>
    /// 退款金额（单位：分）
    /// </summary>
    [JsonPropertyName("refund")]
    public int Refund { get; set; }

    /// <summary>
    /// 用户支付金额（单位：分）
    /// </summary>
    [JsonPropertyName("payer_total")]
    public int PayerTotal { get; set; }

    /// <summary>
    /// 用户退款金额（单位：分）
    /// </summary>
    [JsonPropertyName("payer_refund")]
    public int PayerRefund { get; set; }
}

#endregion

#region V3 错误响应模型

/// <summary>
/// V3 API 错误响应
/// </summary>
public class WechatPayV3ErrorResponse
{
    /// <summary>
    /// 错误码
    /// </summary>
    [JsonPropertyName("code")]
    public string Code { get; set; } = string.Empty;

    /// <summary>
    /// 错误信息
    /// </summary>
    [JsonPropertyName("message")]
    public string Message { get; set; } = string.Empty;

    /// <summary>
    /// 详细错误信息
    /// </summary>
    [JsonPropertyName("detail")]
    public WechatPayV3ErrorDetail? Detail { get; set; }
}

/// <summary>
/// V3 错误详情
/// </summary>
public class WechatPayV3ErrorDetail
{
    /// <summary>
    /// 字段名
    /// </summary>
    [JsonPropertyName("field")]
    public string Field { get; set; } = string.Empty;

    /// <summary>
    /// 字段值
    /// </summary>
    [JsonPropertyName("value")]
    public string Value { get; set; } = string.Empty;

    /// <summary>
    /// 问题描述
    /// </summary>
    [JsonPropertyName("issue")]
    public string Issue { get; set; } = string.Empty;

    /// <summary>
    /// 位置
    /// </summary>
    [JsonPropertyName("location")]
    public string Location { get; set; } = string.Empty;
}

#endregion

#region V3 交易状态常量

/// <summary>
/// V3 交易状态常量
/// </summary>
public static class WechatPayV3TradeState
{
    /// <summary>
    /// 支付成功
    /// </summary>
    public const string Success = "SUCCESS";

    /// <summary>
    /// 转入退款
    /// </summary>
    public const string Refund = "REFUND";

    /// <summary>
    /// 未支付
    /// </summary>
    public const string NotPay = "NOTPAY";

    /// <summary>
    /// 已关闭
    /// </summary>
    public const string Closed = "CLOSED";

    /// <summary>
    /// 已撤销（仅付款码支付）
    /// </summary>
    public const string Revoked = "REVOKED";

    /// <summary>
    /// 用户支付中（仅付款码支付）
    /// </summary>
    public const string UserPaying = "USERPAYING";

    /// <summary>
    /// 支付失败（仅付款码支付）
    /// </summary>
    public const string PayError = "PAYERROR";
}

/// <summary>
/// V3 退款状态常量
/// </summary>
public static class WechatPayV3RefundStatus
{
    /// <summary>
    /// 退款成功
    /// </summary>
    public const string Success = "SUCCESS";

    /// <summary>
    /// 退款关闭
    /// </summary>
    public const string Closed = "CLOSED";

    /// <summary>
    /// 退款处理中
    /// </summary>
    public const string Processing = "PROCESSING";

    /// <summary>
    /// 退款异常
    /// </summary>
    public const string Abnormal = "ABNORMAL";
}

/// <summary>
/// V3 回调事件类型常量
/// </summary>
public static class WechatPayV3EventType
{
    /// <summary>
    /// 支付成功
    /// </summary>
    public const string TransactionSuccess = "TRANSACTION.SUCCESS";

    /// <summary>
    /// 退款成功
    /// </summary>
    public const string RefundSuccess = "REFUND.SUCCESS";

    /// <summary>
    /// 退款异常
    /// </summary>
    public const string RefundAbnormal = "REFUND.ABNORMAL";

    /// <summary>
    /// 退款关闭
    /// </summary>
    public const string RefundClosed = "REFUND.CLOSED";
}

#endregion


#region 回调版本枚举

/// <summary>
/// 微信支付回调版本
/// </summary>
public enum NotifyVersion
{
    /// <summary>
    /// 未知版本
    /// </summary>
    Unknown = 0,

    /// <summary>
    /// V2 版本（XML 格式）
    /// </summary>
    V2 = 2,

    /// <summary>
    /// V3 版本（JSON 格式）
    /// </summary>
    V3 = 3
}

#endregion


#region V3 回调请求头

/// <summary>
/// 微信支付回调请求头
/// </summary>
public class WechatPayNotifyHeaders
{
    /// <summary>
    /// 时间戳（Wechatpay-Timestamp）
    /// </summary>
    public string Timestamp { get; set; } = string.Empty;

    /// <summary>
    /// 随机串（Wechatpay-Nonce）
    /// </summary>
    public string Nonce { get; set; } = string.Empty;

    /// <summary>
    /// 签名（Wechatpay-Signature）
    /// </summary>
    public string Signature { get; set; } = string.Empty;

    /// <summary>
    /// 证书序列号（Wechatpay-Serial）
    /// </summary>
    public string Serial { get; set; } = string.Empty;

    /// <summary>
    /// 签名类型（Wechatpay-Signature-Type，默认 WECHATPAY2-SHA256-RSA2048）
    /// </summary>
    public string SignatureType { get; set; } = "WECHATPAY2-SHA256-RSA2048";
}

#endregion
