Commit 7a0753e1 by chongli

增加微信退款回调功能

parent 41ed0a21
......@@ -115,6 +115,31 @@ public class NotifyController {
return null;
}
/**
* 微信退款通知
*/
@RequestMapping(value = "/weiXinRefoundNotifyUrl", produces = "application/json;charset=UTF-8")
@ResponseBody
public String weiXinRefoundNotifyUrl(HttpServletRequest request,HttpServletResponse response) throws Exception{
BufferedReader reader = null;
reader = request.getReader();
String line = "";
String xmlString = null;
StringBuffer inputString = new StringBuffer();
while ((line = reader.readLine()) != null) {
inputString.append(line);
}
xmlString = inputString.toString();
request.getReader().close();
System.out.println("----接收到的数据如下:---" + xmlString);
this.notifyService.notifyForVoucherMiniApp(xmlString);
response.getWriter().write("<xml><return_code><![CDATA[SUCCESS]]></return_code></xml>");
return null;
}
public NotifyService getNotifyService() {
return notifyService;
......
......@@ -70,6 +70,17 @@ public class NotifyService {
}).getBody();
return response;
}
/**
* 微信退款
* @param paymentResponse
* @return
*/
public String weiXinRefoundNotifyUrl(String orderType,String xml) {
HttpEntity<String> entity = new HttpEntity<String>(xml);
String response = restTemplate.exchange(this.getServerBaseNotifyPath()+"/"+orderType+"/weiXinRefoundNotifyUrl", HttpMethod.POST, entity, new ParameterizedTypeReference<String>() {
}).getBody();
return null;
}
public RestTemplate getRestTemplate() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment