【重要】主要调整了Pay3Api#refundApply退款参数
This commit is contained in:
@@ -45,6 +45,7 @@ import com.foxinmy.weixin4j.type.MediaType;
|
||||
import com.foxinmy.weixin4j.util.FileUtil;
|
||||
import com.foxinmy.weixin4j.util.IOUtil;
|
||||
import com.foxinmy.weixin4j.util.ObjectId;
|
||||
import com.foxinmy.weixin4j.util.RegexUtil;
|
||||
import com.foxinmy.weixin4j.util.StringUtil;
|
||||
import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
|
||||
import com.foxinmy.weixin4j.util.Weixin4jConst;
|
||||
@@ -341,8 +342,12 @@ public class MediaApi extends MpApi {
|
||||
.getCode()), jsonResult.getDesc());
|
||||
}
|
||||
}
|
||||
String fileName = String.format("%s.%s", mediaId,
|
||||
contentType.split("/")[1]);
|
||||
String fileName = RegexUtil
|
||||
.regexFileNameFromContentDispositionHeader(disposition);
|
||||
if (StringUtil.isBlank(fileName)) {
|
||||
fileName = String.format("%s.%s", mediaId,
|
||||
contentType.split("/")[1]);
|
||||
}
|
||||
return new MediaDownloadResult(content,
|
||||
ContentType.create(contentType), fileName);
|
||||
} catch (IOException e) {
|
||||
|
||||
@@ -55,7 +55,7 @@ public class MediaTest extends TokenTest {
|
||||
@Test
|
||||
public void download1() throws WeixinException, IOException {
|
||||
MediaDownloadResult content = mediaApi.downloadMedia(
|
||||
"zloeIROuS3YJFZwugGNM5oGBolqJmU_8FKTUmJwTFbSjfky904S9OPly5Wq0BRn2", true);
|
||||
"V4GvAetzQQjj_ECx1Siqvccgm80a32tk1gRusOBYMk8Uouybl-CwSkGk8w7wKgvI", false);
|
||||
Assert.assertTrue(content != null);
|
||||
System.err.println(content);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user