From 07e29422c8559295bd6a5594e6f95f9e08d0bc95 Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期四, 31 三月 2022 17:07:48 +0800 Subject: [PATCH] 党建bug修改 --- springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/WxPayUtils.java | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/WxPayUtils.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/WxPayUtils.java index 26e450e..e45714e 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/WxPayUtils.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/WxPayUtils.java @@ -77,7 +77,7 @@ return parameters; } public static String h5pay(String appid, String mchId, String payKey, String notifyUrl, String body, - String openid, String outTradeNo, BigDecimal money, String tradeType) { + String openid, String outTradeNo, BigDecimal money, String tradeType, String clientIp) { String nonceStr = PayUtil.makeUUID(32); SortedMap<Object, Object> params = new TreeMap<>(); params.put("appid", appid); @@ -87,7 +87,7 @@ params.put("notify_url", notifyUrl); params.put("openid", openid); params.put("out_trade_no", outTradeNo);// 商品订单号 - params.put("spbill_create_ip", PayUtil.getLocalIp());// 服务部署的ip + params.put("spbill_create_ip", clientIp);// 用户真实ip params.put("total_fee", PayUtil.moneyToIntegerStr(money));// 费用的参数转型 params.put("trade_type", tradeType);// 对接类型 params.put("sign", PayUtil.createSign(PayCpmstant.DEFAULT_ENCODING, params, payKey));// MD5签名 @@ -122,11 +122,13 @@ result.put("package", prepayId); result.put("signType", PayCpmstant.SIGN_TYPE); result.put("paySign", PayUtil.createSign(PayCpmstant.DEFAULT_ENCODING, payParams, payKey)); - } - else if(tradeType.equals("NATIVE")){ - result.put("codeUrl",data.getString("code_url")); - } } + else if(tradeType.equals("NATIVE")) { + result.put("codeUrl",data.getString("code_url")); + } else if(tradeType.equals("MWEB")) { + result.put("mWebUrl",data.getString("mweb_url")); + } + } -- Gitblit v1.7.1