File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
weixin-java-pay/src/main/java/com/github/binarywang/wxpay Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .github .binarywang .wxpay .bean .order ;
2+
3+ import com .thoughtworks .xstream .annotations .XStreamAlias ;
4+ import lombok .Builder ;
5+ import lombok .Data ;
6+
7+ /**
8+ * <pre>
9+ * 微信H5支付统一下单后发起支付拼接所需参数实现类.
10+ * Created by Binary Wang on 2018-4-21.
11+ * </pre>
12+ *
13+ * @author <a href="https://github.com/binarywang">Binary Wang</a>
14+ */
15+ @ Data
16+ @ Builder
17+ public class WxPayMwebOrderResult {
18+ @ XStreamAlias ("mwebUrl" )
19+ private String mwebUrl ;
20+ }
Original file line number Diff line number Diff line change 1313import java .util .Map ;
1414import java .util .zip .ZipException ;
1515
16+ import com .github .binarywang .wxpay .bean .order .WxPayMwebOrderResult ;
1617import org .apache .commons .lang3 .StringUtils ;
1718import org .slf4j .Logger ;
1819import org .slf4j .LoggerFactory ;
@@ -285,6 +286,12 @@ public <T> T createOrder(WxPayUnifiedOrderRequest request) throws WxPayException
285286 String timestamp = String .valueOf (System .currentTimeMillis () / 1000 );
286287 String nonceStr = String .valueOf (System .currentTimeMillis ());
287288 switch (request .getTradeType ()) {
289+ case TradeType .MWEB : {
290+ return (T ) WxPayMwebOrderResult .builder ()
291+ .mwebUrl (unifiedOrderResult .getMwebUrl ())
292+ .build ();
293+ }
294+
288295 case TradeType .NATIVE : {
289296 return (T ) WxPayNativeOrderResult .builder ()
290297 .codeUrl (unifiedOrderResult .getCodeURL ())
You can’t perform that action at this time.
0 commit comments