File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed
src/main/java/com/wechat/pay/contrib/apache/httpclient/auth Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 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
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
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ plugins {
55}
66
77group ' com.github.wechatpay-apiv3'
8- version ' 0.2.4 '
8+ version ' 0.3.0 '
99
1010sourceCompatibility = 1.8
1111targetCompatibility = 1.8
Original file line number Diff line number Diff line change 66import java .util .concurrent .locks .ReentrantLock ;
77
88/**
9- * 在原有 CertificatesVerifier 基础上,增加定时更新证书功能(默认1天 )
9+ * 在原有 CertificatesVerifier 基础上,增加定时更新证书功能(默认1小时 )
1010 */
1111public 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 ;
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments