@ResponseBody
@SneakyThrows
@ApiLog("微信渠道支付回调")
@PostMapping("/wechat/payNotify")
public String payNotify(HttpServletRequest request) {
String xmlMsg = HttpKit.readData(request);
log.info("微信渠道支付回调的xmlMsg ------------- " + xmlMsg);
Map<String, String> params = WxPayKit.xmlToMap(xmlMsg);
if (WxPayKit.verifyNotify(params, WxPayApiConfigKit.getWxPayApiConfig().getPartnerKey(), SignType.HMACSHA256)) {
log.info("微信渠道支付回调的param-------" + JsonUtil.toJson(params));
String returnCode = params.get("return_code");
if (WxPayKit.codeIsOk(returnCode)) {
String orderType = params.get("attach");
String orderId = params.get("out_trade_no");
this.notifyDealBusiness(orderType, orderId);
Map<String, String> xml = new HashMap<String, String>(2);
xml.put("return_code", "SUCCESS");
xml.put("return_msg", "OK");
return WxPayKit.toXml(xml);
}
}
return null;
}
原始报文日志信息打印确认下