|
@@ -25,14 +25,15 @@ public class WxController {
|
|
private WxService wxService;
|
|
private WxService wxService;
|
|
|
|
|
|
@RequestMapping(value = "notify")
|
|
@RequestMapping(value = "notify")
|
|
- public void notify(@RequestBody NotifyBO notifyBO, HttpServletResponse response) throws Exception{
|
|
|
|
|
|
+ public void notify(@RequestBody NotifyBO notifyBO, HttpServletResponse response) throws Exception {
|
|
log.info("wx pay notify;{}", JSONUtil.toJsonStr(notifyBO));
|
|
log.info("wx pay notify;{}", JSONUtil.toJsonStr(notifyBO));
|
|
response.setContentType("application/json");
|
|
response.setContentType("application/json");
|
|
response.setCharacterEncoding("UTF-8");
|
|
response.setCharacterEncoding("UTF-8");
|
|
Writer writer = response.getWriter();
|
|
Writer writer = response.getWriter();
|
|
- Map<String,String>result=new HashMap<>();
|
|
|
|
|
|
+ Map<String, String> result = new HashMap<>();
|
|
result.put("return_code", "SUCCESS");
|
|
result.put("return_code", "SUCCESS");
|
|
result.put("return_msg", "OK");
|
|
result.put("return_msg", "OK");
|
|
|
|
+ notifyBO.setTradeStatus("SUCCESS");
|
|
wxService.WxNotify(notifyBO);
|
|
wxService.WxNotify(notifyBO);
|
|
writer.write(XmlUtil.mapToXmlStr(result));
|
|
writer.write(XmlUtil.mapToXmlStr(result));
|
|
writer.flush();
|
|
writer.flush();
|
|
@@ -46,20 +47,22 @@ public class WxController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "pre-pay")
|
|
@RequestMapping(value = "pre-pay")
|
|
- public AjaxJson prePay( HttpServletRequest request) throws Exception {
|
|
|
|
|
|
+ public AjaxJson prePay(HttpServletRequest request) throws Exception {
|
|
return AjaxJson.getSuccessData(wxService.prePay(request));
|
|
return AjaxJson.getSuccessData(wxService.prePay(request));
|
|
}
|
|
}
|
|
|
|
|
|
@GetMapping(value = "getRedirectUrl")
|
|
@GetMapping(value = "getRedirectUrl")
|
|
- public AjaxJson getRedirectUrl(String path,@RequestParam(required = false) String state){
|
|
|
|
- return AjaxJson.getSuccessData(wxService.getRedirectUrl(path,state));
|
|
|
|
|
|
+ public AjaxJson getRedirectUrl(String path, @RequestParam(required = false) String state) {
|
|
|
|
+ return AjaxJson.getSuccessData(wxService.getRedirectUrl(path, state));
|
|
}
|
|
}
|
|
|
|
+
|
|
@GetMapping(value = "getOpenidByCode")
|
|
@GetMapping(value = "getOpenidByCode")
|
|
- public AjaxJson getOpenidByCode(String code,@RequestParam(required = false) String openid){
|
|
|
|
- return AjaxJson.getSuccessData(wxService.getOpenidByCode(code,openid));
|
|
|
|
|
|
+ public AjaxJson getOpenidByCode(String code, @RequestParam(required = false) String openid) {
|
|
|
|
+ return AjaxJson.getSuccessData(wxService.getOpenidByCode(code, openid));
|
|
}
|
|
}
|
|
|
|
+
|
|
@GetMapping(value = "getWxConfig")
|
|
@GetMapping(value = "getWxConfig")
|
|
- public AjaxJson getWxConfig(String url){
|
|
|
|
|
|
+ public AjaxJson getWxConfig(String url) {
|
|
return AjaxJson.getSuccessData(wxService.getWxConfig(url));
|
|
return AjaxJson.getSuccessData(wxService.getWxConfig(url));
|
|
}
|
|
}
|
|
}
|
|
}
|