File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 39
39
using SKIT .FlurlHttpClient .Wechat .TenpayV3 ;
40
40
using SKIT .FlurlHttpClient .Wechat .TenpayV3 .Settings ;
41
41
42
- var manager = new InMemoryCertificateManager ();
43
42
var options = new WechatTenpayClientOptions ()
44
43
{
45
44
MerchantId = " 微信商户号" ,
46
45
MerchantV3Secret = " 微信商户 v3 API 密钥" ,
47
46
MerchantCertificateSerialNumber = " 微信商户证书序列号" ,
48
47
MerchantCertificatePrivateKey = System .IO .File .ReadAllText (" /微信商户证书私钥文件路径/apiclient_key.pem" ),
49
- PlatformCertificateManager = manager
48
+
49
+ // 基于平台证书的认证方式还需设置以下参数:
50
+ PlatformAuthScheme = Settings .PlatformAuthScheme .Certificate ,
51
+ PlatformCertificateManager = new InMemoryCertificateManager ()
52
+
53
+ // 基于平台公钥的认证方式还需设置以下参数:
54
+ PlatformAuthScheme = Settings .PlatformAuthScheme .PublicKey ,
55
+ PlatformPublicKeyManager = new InMemoryPublicKeyManager ()
50
56
};
51
57
var client = WechatTenpayClientBuilder .Create (options ).Build ();
52
58
```
53
59
54
- 🔥 平台证书管理器的具体用法请参阅下文的基础用法与加密、验签有关的章节。
55
-
56
- 🔥 另,2024 年 10 月后新注册的微信商户已不再提供平台证书,取而代之的是平台公钥。与平台证书管理器类似,具体用法也请参阅下文的基础用法与加密、验签有关的章节。
60
+ 🔥 平台证书管理器、平台公钥管理器的具体用法请参阅下文的基础用法与加密、验签有关的章节。
57
61
58
62
### 请求 & 响应:
59
63
You can’t perform that action at this time.
0 commit comments