|
|
@@ -234,8 +234,8 @@ public class WxpayController {
|
|
|
//map.put("status", "SUCCESS");
|
|
|
if (WxPayConstants.TradeType.MWEB.equals(wxPayUnifiedOrderRequest.getTradeType())) {
|
|
|
/*H5支付开发步骤:https://pay.weixin.qq.com/wiki/doc/api/H5.php?chapter=15_4*/
|
|
|
- //String mwebUrl = wxPayUnifiedOrderResult.getMwebUrl() + "&redirect_url=" + URLEncoder.encode(redirectUrl,"UTF-8");
|
|
|
- String mwebUrl = wxPayUnifiedOrderResult.getMwebUrl();
|
|
|
+ String mwebUrl = wxPayUnifiedOrderResult.getMwebUrl() + "&redirect_url=" + URLEncoder.encode("http://lj.ubtob.com/project#/donationsOver/" + wxPayUnifiedOrderRequest.getOutTradeNo(),"UTF-8");
|
|
|
+ //String mwebUrl = wxPayUnifiedOrderResult.getMwebUrl();
|
|
|
map.put("mwebUrl", mwebUrl);
|
|
|
} else if (WxPayConstants.TradeType.NATIVE.equals(wxPayUnifiedOrderRequest.getTradeType())) {
|
|
|
//扫码支付
|
|
|
@@ -265,7 +265,7 @@ public class WxpayController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 查询订单支付状态 参数二选一
|
|
|
+ * 查询微信订单支付状态 参数二选一
|
|
|
* @param transactionId
|
|
|
* @param outTradeNo
|
|
|
*/
|
|
|
@@ -280,6 +280,28 @@ public class WxpayController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询商户端订单支付状态
|
|
|
+ * @param outTradeNo
|
|
|
+ */
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping(value = "/queryProjectRecodeState", method = RequestMethod.POST)
|
|
|
+ public String queryProjectRecodeState(@RequestParam String outTradeNo){
|
|
|
+ ProjectRecode projectRecode = projectRecodeService.findOne(Long.parseLong(outTradeNo));
|
|
|
+ if (projectRecode != null) {
|
|
|
+ Short status = projectRecode.getStatus();
|
|
|
+ if (status == 1) {
|
|
|
+ return "WAITING";
|
|
|
+ } else if (status == 2) {
|
|
|
+ return "SUCCESS";
|
|
|
+ } else if (status == 3) {
|
|
|
+ return "EXCEPTION";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "ERROR";
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -386,13 +408,10 @@ public class WxpayController {
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping("/redirectUrl")
|
|
|
- public String redirectUrl(HttpServletRequest request) {
|
|
|
- /*由于设置redirect_url后,回跳指定页面的操作可能发生在:1,微信支付中间页调起微信收银台后超过5秒
|
|
|
- 2,用户点击“取消支付“或支付完成后点“完成”按钮。因此无法保证页面回跳时,支付流程已结束,
|
|
|
- 所以商户设置的redirect_url地址不能自动执行查单操作,应让用户去点击按钮触发查单操作。*/
|
|
|
- //效果图可以参考: https://pay.weixin.qq.com/wiki/doc/api/H5.php?chapter=15_4 最下面
|
|
|
-
|
|
|
- return "h5支付回调";
|
|
|
+ public String redirectUrl(HttpServletRequest request) throws IOException {
|
|
|
+ String xmlResult = IOUtils.toString(request.getInputStream(), request.getCharacterEncoding());
|
|
|
+ logger.info("扫码回调,xmlResult:" + xmlResult);
|
|
|
+ return "扫码回调";
|
|
|
}
|
|
|
|
|
|
/**
|