|
|
@@ -212,13 +212,14 @@ public class WxpayController {
|
|
|
}
|
|
|
|
|
|
WxPayUnifiedOrderRequest wxPayUnifiedOrderRequest = createWxPayUnifiedOrderRequest(request, projectRecode, WxPayConstants.TradeType.MWEB);
|
|
|
+ // currentUrl当有三个参数时去掉第三个
|
|
|
+ currentUrl = getCurrentUrlInH5(currentUrl);
|
|
|
Map map = unifiedOrder(wxPayUnifiedOrderRequest, currentUrl);
|
|
|
if ("FAIL".equals(map.get("status"))) {
|
|
|
modelMap.put("error", map.get("message"));
|
|
|
} else {
|
|
|
modelMap.put("mwebUrl", map.get("mwebUrl"));
|
|
|
}
|
|
|
-
|
|
|
return modelMap;
|
|
|
}
|
|
|
|
|
|
@@ -651,4 +652,19 @@ public class WxpayController {
|
|
|
}
|
|
|
return ip;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 微信h5支付时,对当前用户所在页面路径进行去第三个参数(订单号)处理
|
|
|
+ */
|
|
|
+ private String getCurrentUrlInH5(String currentUrl) {
|
|
|
+ String[] currents = currentUrl.split("/project/detail/");
|
|
|
+ String paraUrl = currents[1];
|
|
|
+ System.out.println(paraUrl);
|
|
|
+ String[] paras = paraUrl.split("/");
|
|
|
+ if (paras.length > 2) {
|
|
|
+ currentUrl = currents[0] + "/project/detail/" + paras[0] + "/" + paras[1];
|
|
|
+ }
|
|
|
+
|
|
|
+ return currentUrl;
|
|
|
+ }
|
|
|
}
|