1
zj
8 days ago 16f5baf41e3224ccb43fce45de968833f9f022d2
src/main/java/com/nq/controller/PayApiController.java
@@ -29,6 +29,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@@ -162,4 +164,29 @@
            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());
        }
    }
}