Skip to content

Commit 37e254e

Browse files
committed
完善README和注释
1 parent 8a4353e commit 37e254e

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
## 项目状态
1010

11-
当前版本`0.2.4`为测试版本。请商户的专业技术人员在使用时注意系统和软件的正确性和兼容性,以及带来的风险。
11+
当前版本`0.3.0`为测试版本。请商户的专业技术人员在使用时注意系统和软件的正确性和兼容性,以及带来的风险。
12+
13+
## 升级指引
14+
版本`0.3.0``Verifier`接口新增了`getLatestCertificate`方法。如果你已经在使用版本<`0.3.0`的SDK,且使用自定义类实现了`Verifier`接口,在升级版本为`0.3.0`时,请在自定义类中实现`getLatestCertificate`方法。
1215

1316
## 环境要求
1417

@@ -23,7 +26,7 @@
2326
在你的`build.gradle`文件中加入如下的依赖
2427

2528
```groovy
26-
implementation 'com.github.wechatpay-apiv3:wechatpay-apache-httpclient:0.2.4'
29+
implementation 'com.github.wechatpay-apiv3:wechatpay-apache-httpclient:0.3.0'
2730
```
2831

2932
### Maven
@@ -33,7 +36,7 @@ implementation 'com.github.wechatpay-apiv3:wechatpay-apache-httpclient:0.2.4'
3336
<dependency>
3437
<groupId>com.github.wechatpay-apiv3</groupId>
3538
<artifactId>wechatpay-apache-httpclient</artifactId>
36-
<version>0.2.4</version>
39+
<version>0.3.0</version>
3740
</dependency>
3841
```
3942

@@ -180,7 +183,7 @@ WechatPayHttpClientBuilder builder = WechatPayHttpClientBuilder.create()
180183

181184
替换`自动更新证书功能`
182185

183-
版本`>=0.2.4`可使用 ScheduledUpdateCertificatesVerifier 类替代默认的验签器。它会定时下载和更新商户对应的[微信支付平台证书](https://wechatpay-api.gitbook.io/wechatpay-api-v3/ren-zheng/zheng-shu#ping-tai-zheng-shu)默认为1天)。
186+
版本>=`0.3.0`可使用 ScheduledUpdateCertificatesVerifier 类替代默认的验签器。它会定时下载和更新商户对应的[微信支付平台证书](https://wechatpay-api.gitbook.io/wechatpay-api-v3/ren-zheng/zheng-shu#ping-tai-zheng-shu)默认为1小时)。
184187

185188
示例代码:
186189

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group 'com.github.wechatpay-apiv3'
8-
version '0.2.4'
8+
version '0.3.0'
99

1010
sourceCompatibility = 1.8
1111
targetCompatibility = 1.8

src/main/java/com/wechat/pay/contrib/apache/httpclient/auth/ScheduledUpdateCertificatesVerifier.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
import java.util.concurrent.locks.ReentrantLock;
77

88
/**
9-
* 在原有 CertificatesVerifier 基础上,增加定时更新证书功能(默认1天
9+
* 在原有 CertificatesVerifier 基础上,增加定时更新证书功能(默认1小时
1010
*/
1111
public class ScheduledUpdateCertificatesVerifier implements Verifier {
1212

13-
protected static final int UPDATE_INTERVAL_MINUTE = 1440;
13+
protected static final int UPDATE_INTERVAL_MINUTE = 60;
1414
private final ReentrantLock lock;
1515
private final CertManagerSingleton certManagerSingleton;
1616
private final CertificatesVerifier verifier;

src/main/java/com/wechat/pay/contrib/apache/httpclient/auth/Verifier.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ public interface Verifier {
1515
@Deprecated
1616
X509Certificate getValidCertificate();
1717

18+
/**
19+
* 获取最新的证书
20+
*
21+
* @return
22+
*/
1823
X509Certificate getLatestCertificate();
1924

2025
}

0 commit comments

Comments
 (0)