2021-05-10 15:30:00 +08:00
|
|
|
|
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2021-07-11 00:55:41 +08:00
|
|
|
|
/// 一个用于构造 <see cref="WechatTenpayClient"/> 时使用的配置项。
|
2021-05-10 15:30:00 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class WechatTenpayClientOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2021-06-10 15:43:55 +08:00
|
|
|
|
/// 获取或设置请求超时时间(单位:毫秒)。
|
2024-01-29 23:12:37 +08:00
|
|
|
|
/// <para>
|
|
|
|
|
|
/// 默认值:30000
|
|
|
|
|
|
/// </para>
|
2021-05-10 15:30:00 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int Timeout { get; set; } = 30 * 1000;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2023-03-12 08:05:24 +08:00
|
|
|
|
/// 获取或设置微信支付 API 入口点。
|
2024-01-29 23:12:37 +08:00
|
|
|
|
/// <para>
|
|
|
|
|
|
/// 默认值:<see cref="WechatTenpayEndpoints.DEFAULT"/>
|
|
|
|
|
|
/// </para>
|
2021-05-10 15:30:00 +08:00
|
|
|
|
/// </summary>
|
2023-03-12 08:05:24 +08:00
|
|
|
|
public string Endpoint { get; set; } = WechatTenpayEndpoints.DEFAULT;
|
2021-05-10 15:30:00 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-06-10 15:43:55 +08:00
|
|
|
|
/// 获取或设置声明应答中的错误描述使用的自然语言语种。
|
2024-01-29 23:12:37 +08:00
|
|
|
|
/// <para>
|
2024-05-06 20:50:58 +08:00
|
|
|
|
/// 默认值:"zh-CN"
|
2024-01-29 23:12:37 +08:00
|
|
|
|
/// </para>
|
2021-05-10 15:30:00 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string AcceptLanguage { get; set; } = "zh-CN";
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-06-10 15:43:55 +08:00
|
|
|
|
/// 获取或设置微信支付 API 签名认证方式。
|
2024-01-29 23:12:37 +08:00
|
|
|
|
/// <para>
|
|
|
|
|
|
/// 默认值:<see cref="Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256"/>
|
|
|
|
|
|
/// </para>
|
2021-05-10 15:30:00 +08:00
|
|
|
|
/// </summary>
|
2022-11-13 23:17:18 +08:00
|
|
|
|
public string SignScheme { get; set; } = Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256;
|
2021-05-10 15:30:00 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-01-21 14:41:40 +08:00
|
|
|
|
/// 获取或设置微信支付商户号。
|
2021-05-10 15:30:00 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string MerchantId { get; set; } = default!;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-01-21 14:41:40 +08:00
|
|
|
|
/// 获取或设置微信支付商户 API v3 密钥(注意与 API 密钥相区分)。
|
2021-05-10 15:30:00 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string MerchantV3Secret { get; set; } = default!;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-01-21 14:41:40 +08:00
|
|
|
|
/// 获取或设置微信支付商户 API 证书序列号。
|
2021-05-10 15:30:00 +08:00
|
|
|
|
/// </summary>
|
2022-01-21 14:41:40 +08:00
|
|
|
|
public string MerchantCertificateSerialNumber { get; set; } = default!;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取或设置微信支付商户 API 证书私钥(通常为 `apiclient_key.pem` 文件内容)。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string MerchantCertificatePrivateKey { get; set; } = default!;
|
2021-07-20 01:20:31 +08:00
|
|
|
|
|
2021-11-25 18:05:22 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取或设置是否自动加密请求中的敏感字段数据。
|
2024-01-29 23:12:37 +08:00
|
|
|
|
/// <para>
|
|
|
|
|
|
/// 注意:启用该功能需配合 <see cref="PlatformCertificateManager"/> 使用。
|
|
|
|
|
|
/// </para>
|
2021-11-25 18:05:22 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool AutoEncryptRequestSensitiveProperty { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-03-03 11:52:37 +08:00
|
|
|
|
/// 获取或设置是否自动解密响应中的敏感字段数据。
|
2024-01-29 23:12:37 +08:00
|
|
|
|
/// <para>
|
|
|
|
|
|
/// 注意:启用该功能需配合 <see cref="PlatformCertificateManager"/> 使用。
|
|
|
|
|
|
/// </para>
|
2021-11-25 18:05:22 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool AutoDecryptResponseSensitiveProperty { get; set; }
|
|
|
|
|
|
|
2024-11-05 21:19:50 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取或设置微信支付平台认证方案。
|
|
|
|
|
|
/// <para>默认值:<see cref="Settings.PlatformAuthScheme.Certificate"/></para>
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Settings.PlatformAuthScheme PlatformAuthScheme { get; set; } = Settings.PlatformAuthScheme.Certificate;
|
|
|
|
|
|
|
2022-01-21 14:41:40 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取或设置微信支付平台证书管理器。
|
2024-01-29 23:12:37 +08:00
|
|
|
|
/// <para>
|
2024-11-05 21:19:50 +08:00
|
|
|
|
/// 仅当 <see cref="PlatformAuthScheme"/> 的值为 <see cref="Settings.PlatformAuthScheme.Certificate"/> 时有效。
|
|
|
|
|
|
/// </para>
|
|
|
|
|
|
/// <para>
|
2024-01-29 23:12:37 +08:00
|
|
|
|
/// 默认值:<see cref="Settings.InMemoryCertificateManager"/>
|
|
|
|
|
|
/// </para>
|
2021-07-20 01:20:31 +08:00
|
|
|
|
/// </summary>
|
2024-02-06 11:23:04 +08:00
|
|
|
|
public Settings.ICertificateManager PlatformCertificateManager { get; set; } = new Settings.InMemoryCertificateManager();
|
2024-11-05 21:19:50 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取或设置微信支付平台公钥管理器。
|
|
|
|
|
|
/// <para>
|
|
|
|
|
|
/// 仅当 <see cref="PlatformAuthScheme"/> 的值为 <see cref="Settings.PlatformAuthScheme.PublicKey"/> 时有效。
|
|
|
|
|
|
/// </para>
|
|
|
|
|
|
/// <para>
|
|
|
|
|
|
/// 默认值:<see cref="Settings.InMemoryPublicKeyManager"/>
|
|
|
|
|
|
/// </para>
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Settings.IPublicKeyManager PlatformPublicKeyManager { get; set; } = new Settings.InMemoryPublicKeyManager();
|
2021-05-10 15:30:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|