| | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | @Controller |
| | |
| | | log.error("fly notify error Msg = {}", serverResponse.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = {"ococnReturn.do"}, method = {RequestMethod.GET, RequestMethod.POST}) |
| | | public void ococnReturn(HttpServletRequest request, HttpServletResponse response) throws IOException { |
| | | String redirectUrl = this.iPayService.ococnReturn(request); |
| | | response.setContentType("text/html;charset=UTF-8"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | String safeUrl = redirectUrl.replace("\\", "\\\\").replace("'", "\\'"); |
| | | response.getWriter().write( |
| | | "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><title>跳转中</title>" |
| | | + "<script>window.location.replace('" + safeUrl + "');</script>" |
| | | + "</head><body></body></html>" |
| | | ); |
| | | } |
| | | |
| | | @RequestMapping(value = {"ococnNotify.do"}, method = {RequestMethod.GET, RequestMethod.POST}) |
| | | @ResponseBody |
| | | public void ococnNotify(HttpServletRequest request, HttpServletResponse response) throws IOException { |
| | | ServerResponse serverResponse = this.iPayService.ococnNotify(request); |
| | | if (serverResponse.isSuccess()) { |
| | | response.getWriter().write("success"); |
| | | log.info("ococn 支付渠道异步通知处理成功"); |
| | | } else { |
| | | log.error("ococn notify error Msg = {}", serverResponse.getMsg()); |
| | | } |
| | | } |
| | | } |