| @@ -54,6 +54,12 @@ public class WxBusinessOrderController extends BaseController { | |||||
| @ResponseBody | @ResponseBody | ||||
| public Map<String,String> createOrder(@PathVariable String tenantId, HttpServletRequest request){ | public Map<String,String> createOrder(@PathVariable String tenantId, HttpServletRequest request){ | ||||
| logger.info("[" +getIpAddr() + "]微信商圈通知-----"+tenantId); | logger.info("[" +getIpAddr() + "]微信商圈通知-----"+tenantId); | ||||
| Map<String,String> resultMap = new HashMap<>(); | |||||
| if(StringUtils.isBlank(tenantId)){ | |||||
| logger.error("微信商圈通知-----tenantId为空"); | |||||
| resultMap.put("code","FAIL"); | |||||
| return resultMap; | |||||
| } | |||||
| SignatureHeader header = new SignatureHeader(); | SignatureHeader header = new SignatureHeader(); | ||||
| header.setSerialNo(request.getHeader("Wechatpay-Serial")); | header.setSerialNo(request.getHeader("Wechatpay-Serial")); | ||||
| @@ -61,15 +67,10 @@ public class WxBusinessOrderController extends BaseController { | |||||
| header.setNonce(request.getHeader("Wechatpay-Nonce")); | header.setNonce(request.getHeader("Wechatpay-Nonce")); | ||||
| header.setSigned(request.getHeader("Wechatpay-Signature")); | header.setSigned(request.getHeader("Wechatpay-Signature")); | ||||
| logger.info("微信商圈支付通知---header{}"+header.toString()); | |||||
| String body = ((BodyReaderHttpServletRequestWrapper) request).getBody(); | String body = ((BodyReaderHttpServletRequestWrapper) request).getBody(); | ||||
| logger.info("微信商圈支付通知---body{}"+body); | logger.info("微信商圈支付通知---body{}"+body); | ||||
| Map<String,String> resultMap = new HashMap<>(); | |||||
| if(StringUtils.isBlank(tenantId)){ | |||||
| logger.error("微信商圈通知-----tenantId为空"); | |||||
| resultMap.put("code","FAIL"); | |||||
| return resultMap; | |||||
| } | |||||
| TenantEntity tenantEntity = wxMallService.getByTenantId(tenantId); | TenantEntity tenantEntity = wxMallService.getByTenantId(tenantId); | ||||
| if(tenantEntity == null){ | if(tenantEntity == null){ | ||||
| logger.error("微信商圈通知-----获取tenantEntity为null"); | logger.error("微信商圈通知-----获取tenantEntity为null"); | ||||
| @@ -77,14 +78,13 @@ public class WxBusinessOrderController extends BaseController { | |||||
| return resultMap; | return resultMap; | ||||
| } | } | ||||
| WxPayService wxPayService = wxPayAccountService.getWxPayService(tenantId); | |||||
| logger.info("微信商圈支付通知---获取wxPayService{}"+wxPayService); | |||||
| if(wxPayService == null){ | |||||
| logger.error("微信商圈通知-----获取wxPayService失败"); | |||||
| resultMap.put("code","FAIL"); | |||||
| return resultMap; | |||||
| } | |||||
| try { | try { | ||||
| WxPayService wxPayService = wxPayAccountService.getWxPayService(tenantId); | |||||
| if(wxPayService == null){ | |||||
| logger.error("微信商圈通知-----获取wxPayService失败"); | |||||
| resultMap.put("code","FAIL"); | |||||
| return resultMap; | |||||
| } | |||||
| //----------------签名验证----------- | //----------------签名验证----------- | ||||
| // BusinessCircleNotifyData notifyData = verifySignature(request,wxPayService); | // BusinessCircleNotifyData notifyData = verifySignature(request,wxPayService); | ||||
| BusinessCircleNotifyData notifyData = wxPayService.getBusinessCircleService().parseNotifyData(body, header); | BusinessCircleNotifyData notifyData = wxPayService.getBusinessCircleService().parseNotifyData(body, header); | ||||