Skip to content

Commit b7443f4

Browse files
jink2005binarywang
authored andcommitted
#345 修复服务商模式下使用仅有sub_openid时无法预下单的问题.
1 parent 7bb3a12 commit b7443f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayUnifiedOrderRequest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ protected void checkConstraints() throws WxPayException {
339339
// Arrays.toString(TRADE_TYPES), this.getTradeType()));
340340
// }
341341

342-
if ("JSAPI".equals(this.getTradeType()) && this.getOpenid() == null) {
343-
throw new WxPayException("当 trade_type是'JSAPI'时未指定openid");
342+
if ("JSAPI".equals(this.getTradeType()) && this.getOpenid() == null && this.getSubOpenid() == null) {
343+
throw new WxPayException("当 trade_type是'JSAPI'时未指定openid或sub_openid");
344344
}
345345

346346
if ("NATIVE".equals(this.getTradeType()) && this.getProductId() == null) {

0 commit comments

Comments
 (0)