mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-24 07:23:01 +08:00
#247 统一下单接口支持H5支付,并去掉交易类型trade_type的校验
This commit is contained in:
parent
563302eef6
commit
228b3791ae
@ -27,7 +27,7 @@ import java.util.Arrays;
|
|||||||
*/
|
*/
|
||||||
@XStreamAlias("xml")
|
@XStreamAlias("xml")
|
||||||
public class WxPayUnifiedOrderRequest extends WxPayBaseRequest {
|
public class WxPayUnifiedOrderRequest extends WxPayBaseRequest {
|
||||||
private static final String[] TRADE_TYPES = new String[]{"JSAPI", "NATIVE", "APP"};
|
private static final String[] TRADE_TYPES = new String[]{"JSAPI", "NATIVE", "APP","MWEB"};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -443,10 +443,10 @@ public class WxPayUnifiedOrderRequest extends WxPayBaseRequest {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void checkConstraints() {
|
protected void checkConstraints() {
|
||||||
if (!ArrayUtils.contains(TRADE_TYPES, this.getTradeType())) {
|
// if (!ArrayUtils.contains(TRADE_TYPES, this.getTradeType())) {
|
||||||
throw new IllegalArgumentException(String.format("trade_type目前必须为%s其中之一,实际值:%s",
|
// throw new IllegalArgumentException(String.format("trade_type目前必须为%s其中之一,实际值:%s",
|
||||||
Arrays.toString(TRADE_TYPES), this.getTradeType()));
|
// Arrays.toString(TRADE_TYPES), this.getTradeType()));
|
||||||
}
|
// }
|
||||||
|
|
||||||
if ("JSAPI".equals(this.getTradeType()) && this.getOpenid() == null) {
|
if ("JSAPI".equals(this.getTradeType()) && this.getOpenid() == null) {
|
||||||
throw new IllegalArgumentException("当 trade_type是'JSAPI'时未指定openid");
|
throw new IllegalArgumentException("当 trade_type是'JSAPI'时未指定openid");
|
||||||
|
@ -25,6 +25,12 @@ public class WxPayUnifiedOrderResult extends WxPayBaseResult {
|
|||||||
@XStreamAlias("trade_type")
|
@XStreamAlias("trade_type")
|
||||||
private String tradeType;
|
private String tradeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mweb_url 支付跳转链接
|
||||||
|
*/
|
||||||
|
@XStreamAlias("mweb_url")
|
||||||
|
private String mwebUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* trade_type为NATIVE时有返回,用于生成二维码,展示给用户进行扫码支付
|
* trade_type为NATIVE时有返回,用于生成二维码,展示给用户进行扫码支付
|
||||||
*/
|
*/
|
||||||
@ -54,4 +60,12 @@ public class WxPayUnifiedOrderResult extends WxPayBaseResult {
|
|||||||
public void setCodeURL(String codeURL) {
|
public void setCodeURL(String codeURL) {
|
||||||
this.codeURL = codeURL;
|
this.codeURL = codeURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMwebUrl() {
|
||||||
|
return mwebUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMwebUrl(String mwebUrl) {
|
||||||
|
this.mwebUrl = mwebUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user