| @@ -67,13 +67,13 @@ public class WxPayController extends BaseController { | |||
| paramMap = WxPayment.xmlToMap(resultxml); | |||
| logger.info("微信支付回调, notify, param: " + paramMap.toString() ); | |||
| String response = wxPayOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||
| logger.info("微信支付回调, notify success, req : " + paramMap.toString() + ", resp: " + response.toString()); | |||
| logger.info("微信支付回调, notify success, req : " + resultxml + ", resp: " + response.toString()); | |||
| return response; | |||
| } catch (BizMessageException e) { | |||
| if (paramMap == null) { | |||
| logger.error("微信支付回调, order create error, e: " + e.getMessage()); | |||
| } else { | |||
| logger.error("微信支付回调, order create error, req: " + paramMap.toString() + ", e: " + e.getMessage()); | |||
| logger.error("微信支付回调, order create error, req: " + resultxml + ", e: " + e.getMessage()); | |||
| } | |||
| SortedMap resultMap = new TreeMap<>(); | |||
| resultMap.put("return_code", "FAIL"); | |||
| @@ -83,7 +83,7 @@ public class WxPayController extends BaseController { | |||
| if (paramMap == null) { | |||
| logger.error("微信支付回调, order create error, e: " + e.getMessage()); | |||
| } else { | |||
| logger.error("微信支付回调, order create error, req: " + paramMap.toString() + ", e: " + e.getMessage()); | |||
| logger.error("微信支付回调, order create error, req: " + resultxml + ", e: " + e.getMessage()); | |||
| } | |||
| SortedMap resultMap = new TreeMap<>(); | |||
| resultMap.put("return_code", "FAIL"); | |||
| @@ -93,7 +93,7 @@ public class WxPayController extends BaseController { | |||
| if (paramMap == null) { | |||
| logger.error("微信支付回调, order create error, e: " + e.getMessage()); | |||
| } else { | |||
| logger.error("微信支付回调, order create error, req: " + paramMap.toString() + ", e: " + e.getMessage()); | |||
| logger.error("微信支付回调, order create error, req: " + resultxml + ", e: " + e.getMessage()); | |||
| } | |||
| SortedMap resultMap = new TreeMap(); | |||
| resultMap.put("return_code", "FAIL"); | |||
| @@ -111,28 +111,29 @@ public class WxPayController extends BaseController { | |||
| @RequestMapping(value = "/refund") | |||
| public String __refundNotify(HttpServletRequest request) throws Exception { | |||
| Map<String, String> paramMap = null; | |||
| String response; | |||
| String response = ""; | |||
| String xml = ""; | |||
| try { | |||
| String xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | |||
| xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | |||
| logger.info(xml); | |||
| paramMap = WxPayment.xmlToMap(xml); | |||
| logger.info("refund wxpay, notify, param: " + paramMap.toString() ); | |||
| response = wxRefundOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||
| logger.info("refund wxpay, notify success, req : " + paramMap.toString() + ", resp: " + response.toString()); | |||
| logger.info("refund wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | |||
| return response; | |||
| } catch (BizMessageException e) { | |||
| logger.error("refund wxpay, notify error, req: " + paramMap.toString() + ", e:" + e.getLocalizedMessage()); | |||
| logger.error("refund wxpay, notify error, req: " + xml + ", e:" + e.getLocalizedMessage()); | |||
| SortedMap resultMap = new TreeMap(); | |||
| resultMap.put("return_code", "FAIL"); | |||
| resultMap.put("return_msg", e.getMessage()); | |||
| return XmlUtil.getRequestXml(resultMap); | |||
| } catch (MallinkException e) { | |||
| logger.error("refund wxpay, notify error, req: " + paramMap.toString() + ", e:" +e.getLocalizedMessage()); | |||
| logger.error("refund wxpay, notify error, req: " + xml + ", e:" +e.getLocalizedMessage()); | |||
| SortedMap resultMap = new TreeMap(); | |||
| resultMap.put("return_code", "FAIL"); | |||
| resultMap.put("return_msg", e.getMessage()); | |||
| return XmlUtil.getRequestXml(resultMap); | |||
| } catch (Exception e) { | |||
| logger.error("refund wxpay, order create error, req: " + paramMap.toString() + ", e: " + e.getMessage()); | |||
| logger.error("refund wxpay, order create error, req: " + xml + ", e: " + e.getMessage()); | |||
| SortedMap resultMap = new TreeMap(); | |||
| resultMap.put("return_code", "FAIL"); | |||
| resultMap.put("return_msg", e.getMessage()); | |||
| @@ -148,28 +149,29 @@ public class WxPayController extends BaseController { | |||
| @RequestMapping(value = "/sharing") | |||
| public String __shareNotify(HttpServletRequest request) throws Exception { | |||
| Map<String, String> paramMap = null; | |||
| String response; | |||
| String response = ""; | |||
| String xml = ""; | |||
| try { | |||
| String xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | |||
| xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | |||
| paramMap = WxPayment.xmlToMap(xml); | |||
| logger.info("share wxpay, notify, param: " + paramMap.toString() ); | |||
| logger.info("share wxpay, notify, param: " + xml ); | |||
| response = wxPayOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||
| logger.info("share wxpay, notify success, req : " + paramMap.toString() + ", resp: " + response.toString()); | |||
| logger.info("share wxpay, notify success, req : " + xml + ", resp: " + response.toString()); | |||
| return response; | |||
| } catch (BizMessageException e) { | |||
| logger.error("share wxpay, notify error, req: " + paramMap.toString() + ", e:" + e.getLocalizedMessage()); | |||
| logger.error("share wxpay, notify error, req: " + xml + ", e:" + e.getLocalizedMessage()); | |||
| SortedMap resultMap = new TreeMap(); | |||
| resultMap.put("return_code", "FAIL"); | |||
| resultMap.put("return_msg", e.getMessage()); | |||
| return XmlUtil.getRequestXml(resultMap); | |||
| } catch (MallinkException e) { | |||
| logger.error("refund wxpay, notify error, req: " + paramMap.toString() + ", e:" +e.getLocalizedMessage()); | |||
| logger.error("refund wxpay, notify error, req: " + xml + ", e:" +e.getLocalizedMessage()); | |||
| SortedMap resultMap = new TreeMap(); | |||
| resultMap.put("return_code", "FAIL"); | |||
| resultMap.put("return_msg", e.getMessage()); | |||
| return XmlUtil.getRequestXml(resultMap); | |||
| } catch (Exception e) { | |||
| logger.error("refund wxpay, order create error, req: " + paramMap.toString() + ", e: " + e.getMessage()); | |||
| logger.error("refund wxpay, order create error, req: " + xml + ", e: " + e.getMessage()); | |||
| SortedMap resultMap = new TreeMap(); | |||
| resultMap.put("return_code", "FAIL"); | |||
| resultMap.put("return_msg", e.getMessage()); | |||