mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-23 21:56:06 +08:00
规范notifyUrl字段属性写法
This commit is contained in:
parent
48fb5e9e5a
commit
1a4ca8c0bd
@ -8,7 +8,7 @@ import java.nio.file.Files;
|
||||
public class FileUtils {
|
||||
|
||||
/**
|
||||
* 创建临时文件
|
||||
* 创建临时文件.
|
||||
*
|
||||
* @param inputStream 输入文件流
|
||||
* @param name 文件名
|
||||
@ -24,7 +24,7 @@ public class FileUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建临时文件
|
||||
* 创建临时文件.
|
||||
*
|
||||
* @param inputStream 输入文件流
|
||||
* @param name 文件名
|
||||
|
@ -56,11 +56,14 @@ public class OkHttpMediaDownloadRequestExecutor extends BaseMediaDownloadRequest
|
||||
return null;
|
||||
}
|
||||
|
||||
File file = File.createTempFile(FilenameUtils.getBaseName(fileName), FilenameUtils.getExtension(fileName),
|
||||
super.tmpDirFile);
|
||||
File file = File.createTempFile(
|
||||
FilenameUtils.getBaseName(fileName), "." + FilenameUtils.getExtension(fileName), super.tmpDirFile
|
||||
);
|
||||
|
||||
try (BufferedSink sink = Okio.buffer(Okio.sink(file))) {
|
||||
sink.writeAll(response.body().source());
|
||||
}
|
||||
|
||||
file.deleteOnExit();
|
||||
return file;
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ public class WxPayUnifiedOrderRequest extends BaseWxPayRequest {
|
||||
*/
|
||||
@Required
|
||||
@XStreamAlias("notify_url")
|
||||
private String notifyURL;
|
||||
private String notifyUrl;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
@ -319,9 +319,11 @@ public class WxPayUnifiedOrderRequest extends BaseWxPayRequest {
|
||||
|
||||
/**
|
||||
* 如果配置中已经设置,可以不设置值.
|
||||
*
|
||||
* @param notifyUrl 支付回调通知地址
|
||||
*/
|
||||
public void setNotifyURL(String notifyURL) {
|
||||
this.notifyURL = notifyURL;
|
||||
public void setNotifyUrl(String notifyUrl) {
|
||||
this.notifyUrl = notifyUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -342,8 +344,8 @@ public class WxPayUnifiedOrderRequest extends BaseWxPayRequest {
|
||||
|
||||
@Override
|
||||
public void checkAndSign(WxPayConfig config) throws WxPayException {
|
||||
if (StringUtils.isBlank(this.getNotifyURL())) {
|
||||
this.setNotifyURL(config.getNotifyUrl());
|
||||
if (StringUtils.isBlank(this.getNotifyUrl())) {
|
||||
this.setNotifyUrl(config.getNotifyUrl());
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(this.getTradeType())) {
|
||||
|
@ -8,7 +8,6 @@ import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
|
||||
import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult;
|
||||
import com.github.binarywang.wxpay.bean.request.*;
|
||||
import com.github.binarywang.wxpay.bean.result.*;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants.BillType;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants.SignType;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants.TradeType;
|
||||
@ -26,7 +25,7 @@ import java.nio.file.Path;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import static com.github.binarywang.wxpay.constant.WxPayConstants.*;
|
||||
import static com.github.binarywang.wxpay.constant.WxPayConstants.TarType;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.testng.Assert.*;
|
||||
|
||||
@ -53,7 +52,7 @@ public class BaseWxPayServiceImplTest {
|
||||
.body("我去")
|
||||
.totalFee(1)
|
||||
.spbillCreateIp("11.1.11.1")
|
||||
.notifyURL("111111")
|
||||
.notifyUrl("111111")
|
||||
.tradeType(TradeType.JSAPI)
|
||||
.openid(((XmlWxPayConfig) this.payService.getConfig()).getOpenid())
|
||||
.outTradeNo("1111112")
|
||||
@ -76,7 +75,7 @@ public class BaseWxPayServiceImplTest {
|
||||
.body("我去")
|
||||
.totalFee(1)
|
||||
.spbillCreateIp("11.1.11.1")
|
||||
.notifyURL("111111")
|
||||
.notifyUrl("111111")
|
||||
.tradeType(TradeType.JSAPI)
|
||||
.openid(((XmlWxPayConfig) this.payService.getConfig()).getOpenid())
|
||||
.outTradeNo("1111112")
|
||||
@ -92,7 +91,7 @@ public class BaseWxPayServiceImplTest {
|
||||
.body("我去")
|
||||
.totalFee(1)
|
||||
.spbillCreateIp("11.1.11.1")
|
||||
.notifyURL("111111")
|
||||
.notifyUrl("111111")
|
||||
.tradeType(TradeType.APP)
|
||||
.outTradeNo("1111112")
|
||||
.build());
|
||||
@ -108,7 +107,7 @@ public class BaseWxPayServiceImplTest {
|
||||
.totalFee(1)
|
||||
.productId("aaa")
|
||||
.spbillCreateIp("11.1.11.1")
|
||||
.notifyURL("111111")
|
||||
.notifyUrl("111111")
|
||||
.tradeType(TradeType.NATIVE)
|
||||
.outTradeNo("111111290")
|
||||
.build());
|
||||
|
Loading…
Reference in New Issue
Block a user