Skip to content

Commit ff1e5c2

Browse files
committed
完善README
1 parent a864030 commit ff1e5c2

File tree

1 file changed

+6
-36
lines changed

1 file changed

+6
-36
lines changed

README.md

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,47 +12,17 @@
1212

1313
## 升级指引
1414

15-
版本`v0.3.0` 进行了以下变更:
15+
最新版本`0.3.0`重写了[定时更新平台证书功能](#定时更新平台证书功能)。原因参考[issue#66](https://github.com/wechatpay-apiv3/wechatpay-apache-httpclient/issues/66)。此次升级可能导致`Verifier`接口的兼容性问题,建议开发者以如下方式对代码进行更新。
1616

17-
- 增加了[定时更新平台证书功能](#定时更新平台证书功能),替换原来的自动更新平台证书功能。
17+
1. 升级依赖
1818

19-
-`Verifier`接口新增了`getLatestCertificate`方法。
19+
2. 若使用`AutoUpdateCertificatesVerifier`,进行如下操作
2020

21-
以上变更的原因为:
21+
使用`ScheduledUpdateCertificatesVerifier`替换`AutoUpdateCertificatesVerifier`
2222

23-
- 原来的自动更新平台证书功能,在新旧平台证书更换期间,可能导致下载新平台证书时验签不过,可参考 [issue](https://github.com/wechatpay-apiv3/wechatpay-apache-httpclient/issues/66) 。新增的定时更新平台证书功能,可避免上述问题。
23+
3. 若自定义类实现了`Verifier`接口,进行如下操作
2424

25-
- 在新旧平台证书更换期间,需要使用最新的平台证书加密请求消息中的敏感信息,可参考 [微信支付APIv3文档](https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay5_1.shtml)`getValidCertificate`方法不能保证获取最新的平台证书,因此增加`getLatestCertificate`方法来替换使用。
26-
27-
28-
若你正使用版本<`v0.3.0`的SDK,并准备升级为版本`v0.3.0`,请根据以下操作步骤进行。
29-
30-
- 升级依赖
31-
32-
- 使用Gradle管理依赖:将`build.gradle`中的SDK依赖修改为
33-
```groovy
34-
implementation 'com.github.wechatpay-apiv3:wechatpay-apache-httpclient:0.3.0'
35-
```
36-
- 使用Maven管理依赖:将Maven中的SDK依赖修改为
37-
```xml
38-
<dependency>
39-
<groupId>com.github.wechatpay-apiv3</groupId>
40-
<artifactId>wechatpay-apache-httpclient</artifactId>
41-
<version>0.3.0</version>
42-
</dependency>
43-
```
44-
45-
- 实现 getLatestCertificate 方法
46-
47-
**若你没有使用自定义类实现Verifier接口,则无需进行此步骤。**
48-
49-
若你使用自定义类实现了`Verifier`接口,在升级版本为`0.3.0`时,请在自定义类中实现`getLatestCertificate`方法。
50-
51-
- 使用 ScheduledUpdateCertificatesVerifier 替换 AutoUpdateCertificatesVerifier
52-
53-
**若你没有使用AutoUpdateCertificatesVerifier,则无需进行此步骤。**
54-
55-
将代码中使用`AutoUpdateCertificatesVerifier`的地方替换为`ScheduledUpdateCertificatesVerifier`,并修改import的类为`ScheduledUpdateCertificatesVerifier`。
25+
在自定义类中实现`getLatestCertificate`方法。
5626

5727
## 环境要求
5828

0 commit comments

Comments
 (0)