Skip to content

Commit 9436ad9

Browse files
Merge pull request #104 from lianup/master
bump version to 0.4.1
2 parents d8f2850 + 37b0c46 commit 9436ad9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## 项目状态
1010

11-
当前版本`0.4.0`为测试版本。请商户的专业技术人员在使用时注意系统和软件的正确性和兼容性,以及带来的风险。
11+
当前版本`0.4.1`为测试版本。请商户的专业技术人员在使用时注意系统和软件的正确性和兼容性,以及带来的风险。
1212

1313
## 升级指引
1414

@@ -27,7 +27,7 @@
2727
在你的`build.gradle`文件中加入如下的依赖
2828

2929
```groovy
30-
implementation 'com.github.wechatpay-apiv3:wechatpay-apache-httpclient:0.4.0'
30+
implementation 'com.github.wechatpay-apiv3:wechatpay-apache-httpclient:0.4.1'
3131
```
3232

3333
### Maven
@@ -37,7 +37,7 @@ implementation 'com.github.wechatpay-apiv3:wechatpay-apache-httpclient:0.4.0'
3737
<dependency>
3838
<groupId>com.github.wechatpay-apiv3</groupId>
3939
<artifactId>wechatpay-apache-httpclient</artifactId>
40-
<version>0.4.0</version>
40+
<version>0.4.1</version>
4141
</dependency>
4242
```
4343

@@ -246,7 +246,7 @@ try {
246246

247247
我们对上传的参数组装和签名逻辑进行了一定的封装,只需要以下几步:
248248

249-
1. 使用`WechatPayUploadHttpPost`构造一个上传的`HttpPost`,需设置待上传文件的文件名,SHA256摘要,文件的输入流。
249+
1. 使用`WechatPayUploadHttpPost`构造一个上传的`HttpPost`,需设置待上传文件的文件名,SHA256摘要,文件的输入流。`0.4.1`及以上版本,支持设置媒体文件元信息。
250250
2. 通过`WechatPayHttpClientBuilder`得到的`HttpClient`发送请求。
251251

252252
示例请参考下列代码。
@@ -260,6 +260,7 @@ try (FileInputStream ins1 = new FileInputStream(file)) {
260260
String sha256 = DigestUtils.sha256Hex(ins1);
261261
try (InputStream ins2 = new FileInputStream(file)) {
262262
HttpPost request = new WechatPayUploadHttpPost.Builder(uri)
263+
// 如需直接设置媒体文件元信息,可使用withFile代替withImage
263264
.withImage(file.getName(), sha256, ins2)
264265
.build();
265266
CloseableHttpResponse response1 = httpClient.execute(request);

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group 'com.github.wechatpay-apiv3'
8-
version '0.4.0'
8+
version '0.4.1'
99

1010
sourceCompatibility = 1.8
1111
targetCompatibility = 1.8

0 commit comments

Comments
 (0)