mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 01:58:14 +08:00
docs: 完善文档
This commit is contained in:
@@ -65,20 +65,6 @@ if (!res.Result)
|
||||
|
||||
请参阅本文档[《基础用法 - 如何加密请求中的敏感数据?》](./Basic_RequestSensitiveDataEncryption.md)下的同名章节。
|
||||
|
||||
### 适配微信支付新商户的公钥验签方式
|
||||
### 适配微信支付新商户的平台公钥认证方式
|
||||
|
||||
自 v3.9.0 版本起,本库支持接入微信支付平台基于微信支付公钥的验证身份方式。
|
||||
|
||||
你只需要在原有的构造得到 `WechatTenpayClient` 对象的项目代码上做出调整,设置平台认证方案为“使用平台公钥认证”,并使用 `PlatformPublicKeyManager` 属性替代 `PlatformCertificateManager` 属性:
|
||||
|
||||
```csharp
|
||||
var options = new WechatTenpayClientOptions()
|
||||
{
|
||||
// 其他配置项略
|
||||
PlatformAuthScheme = Settings.PlatformAuthScheme.PublicKey,
|
||||
PlatformPublicKeyManager = new Settings.InMemoryPublicKeyManager();
|
||||
};
|
||||
var client = WechatTenpayClientBuilder.Create(options).Build();
|
||||
```
|
||||
|
||||
后续流程与原有方式完全一致。
|
||||
请参阅本文档[《基础用法 - 如何加密请求中的敏感数据?》](./Basic_RequestSensitiveDataEncryption.md)下的同名章节。
|
||||
|
@@ -231,18 +231,21 @@ public class RedisCertificateManager : ICertificateManager
|
||||
|
||||
---
|
||||
|
||||
### 适配微信支付新商户的公钥加密方式
|
||||
### 适配微信支付新商户的平台公钥认证方式
|
||||
|
||||
自 v3.9.0 版本起,本库支持接入微信支付平台基于微信支付公钥的验证身份方式。
|
||||
|
||||
你只需要在原有的构造得到 `WechatTenpayClient` 对象的项目代码上做出调整,设置平台认证方案为“使用平台公钥认证”,并使用 `PlatformPublicKeyManager` 属性替代 `PlatformCertificateManager` 属性:
|
||||
|
||||
```csharp
|
||||
var manager = new Settings.InMemoryPublicKeyManager();
|
||||
manager.AddEntry(new PublicKeyEntry("公钥算法", "公钥序列号", "PKCS#8 公钥内容"));
|
||||
|
||||
var options = new WechatTenpayClientOptions()
|
||||
{
|
||||
// 其他配置项略
|
||||
PlatformAuthScheme = Settings.PlatformAuthScheme.PublicKey,
|
||||
PlatformPublicKeyManager = new Settings.InMemoryPublicKeyManager();
|
||||
PlatformPublicKeyManager = manager
|
||||
};
|
||||
var client = WechatTenpayClientBuilder.Create(options).Build();
|
||||
```
|
||||
|
@@ -74,20 +74,6 @@ if (!res.Result)
|
||||
|
||||
请参阅本文档[《基础用法 - 如何加密请求中的敏感数据?》](./Basic_RequestSensitiveDataEncryption.md)下的同名章节。
|
||||
|
||||
### 适配微信支付新商户的公钥验签方式
|
||||
### 适配微信支付新商户的平台公钥认证方式
|
||||
|
||||
自 v3.9.0 版本起,本库支持接入微信支付平台基于微信支付公钥的验证身份方式。
|
||||
|
||||
你只需要在原有的构造得到 `WechatTenpayClient` 对象的项目代码上做出调整,设置平台认证方案为“使用平台公钥认证”,并使用 `PlatformPublicKeyManager` 属性替代 `PlatformCertificateManager` 属性:
|
||||
|
||||
```csharp
|
||||
var options = new WechatTenpayClientOptions()
|
||||
{
|
||||
// 其他配置项略
|
||||
PlatformAuthScheme = Settings.PlatformAuthScheme.PublicKey,
|
||||
PlatformPublicKeyManager = new Settings.InMemoryPublicKeyManager();
|
||||
};
|
||||
var client = WechatTenpayClientBuilder.Create(options).Build();
|
||||
```
|
||||
|
||||
后续流程与原有方式完全一致。
|
||||
请参阅本文档[《基础用法 - 如何加密请求中的敏感数据?》](./Basic_RequestSensitiveDataEncryption.md)下的同名章节。
|
||||
|
@@ -29,7 +29,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings
|
||||
public string SerialNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取公钥内容(CRT/CER PEM 格式,即 -----BEGIN PUBLIC KEY----- ... -----END PUBLIC KEY-----)
|
||||
/// 获取公钥内容(PKCS#8 PEM 格式,即 -----BEGIN PUBLIC KEY----- ... -----END PUBLIC KEY-----)
|
||||
/// </summary>
|
||||
public string PublicKey { get; }
|
||||
|
||||
|
Reference in New Issue
Block a user