DotNetCore.SKIT.FlurlHttpCl.../src/SKIT.FlurlHttpClient.Wechat.TenpayV2/Settings/Credentials.cs

50 lines
1.8 KiB
C#
Raw Normal View History

using System;
2022-01-20 23:20:03 +08:00
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Settings
{
public class Credentials
{
/// <summary>
/// 初始化客户端时 <see cref="WechatTenpayClientOptions.MerchantId"/> 的副本。
/// </summary>
public string MerchantId { get; }
/// <summary>
/// 初始化客户端时 <see cref="WechatTenpayClientOptions.MerchantSecret"/> 的副本。
/// </summary>
public string MerchantSecret { get; }
/// <summary>
/// 初始化客户端时 <see cref="WechatTenpayClientOptions.MerchantCertificateBytes"/> 的副本。
/// </summary>
public byte[]? MerchantCertificateBytes { get; set; }
/// <summary>
/// 初始化客户端时 <see cref="WechatTenpayClientOptions.MerchantCertificatePassword"/> 的副本。
/// </summary>
public string? MerchantCertificatePassword { get; set; }
/// <summary>
/// 初始化客户端时 <see cref="WechatTenpayClientOptions.AppId"/> 的副本。
/// </summary>
public string? AppId { get; }
/// <summary>
/// 初始化客户端时 <see cref="WechatTenpayClientOptions.WeWorkPaymentSecret"/> 的副本。
/// </summary>
public string? WeWorkPaymentSecret { get; }
2022-01-20 23:20:03 +08:00
internal Credentials(WechatTenpayClientOptions options)
{
2024-01-30 23:01:06 +08:00
if (options is null) throw new ArgumentNullException(nameof(options));
2022-01-20 23:20:03 +08:00
MerchantId = options.MerchantId;
MerchantSecret = options.MerchantSecret;
MerchantCertificateBytes = options.MerchantCertificateBytes;
MerchantCertificatePassword = options.MerchantCertificatePassword;
AppId = options.AppId;
WeWorkPaymentSecret = options.WeWorkPaymentSecret;
2022-01-20 23:20:03 +08:00
}
}
}