From 1efec6bc75abfeed48d23f92dfed9e70cd0257b0 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Tue, 18 Apr 2017 11:17:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../binarywang/wxpay/service/impl/WxPayServiceImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceImpl.java index 5d442df9..0e4dd28d 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceImpl.java @@ -196,10 +196,9 @@ public class WxPayServiceImpl implements WxPayService { } Map payInfo = new HashMap<>(); - if ("NATIVE".equals(request.getTradeType())) - { + if ("NATIVE".equals(request.getTradeType())) { payInfo.put("codeUrl", unifiedOrderResult.getCodeURL()); - }else if ("APP".equals(request.getTradeType())){ + } else if ("APP".equals(request.getTradeType())) { // APP支付绑定的是微信开放平台上的账号,APPID为开放平台上绑定APP后发放的参数 String appId = getConfig().getAppId(); Map configMap = new HashMap<>(); @@ -219,7 +218,7 @@ public class WxPayServiceImpl implements WxPayService { payInfo.put("packageValue", "Sign=WXPay"); payInfo.put("timeStamp", String.valueOf(System.currentTimeMillis() / 1000)); payInfo.put("nonceStr", String.valueOf(System.currentTimeMillis())); - }else if ("JSAPI".equals(request.getTradeType())){ + } else if ("JSAPI".equals(request.getTradeType())) { payInfo.put("appId", unifiedOrderResult.getAppid()); // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 payInfo.put("timeStamp", String.valueOf(System.currentTimeMillis() / 1000));