|
@@ -50,7 +50,7 @@ public class WxPayController {
|
|
|
*/
|
|
|
@ApiOperation("支付通知")
|
|
|
@PostMapping("/native/notify")
|
|
|
- public String nativeNotify(HttpServletRequest request, HttpServletResponse response){
|
|
|
+ public String nativeNotify(HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|
|
Gson gson = new Gson();
|
|
|
Map<String, String> map = new HashMap<>();//应答对象
|
|
@@ -61,13 +61,10 @@ public class WxPayController {
|
|
|
String body = HttpUtils.readData(request);
|
|
|
Map<String, Object> bodyMap = gson.fromJson(body, HashMap.class);
|
|
|
|
|
|
- log.info(bodyMap.toString());
|
|
|
-
|
|
|
- String requestId = (String)bodyMap.get("id");
|
|
|
- log.info("支付通知的id ===>"+requestId);
|
|
|
+ String requestId = (String) bodyMap.get("id");
|
|
|
+ log.info("支付通知的id ===>" + requestId);
|
|
|
|
|
|
//签名的验证
|
|
|
-
|
|
|
if(false){
|
|
|
|
|
|
log.error("通知验签失败");
|
|
@@ -80,11 +77,11 @@ public class WxPayController {
|
|
|
log.info("通知验签成功");
|
|
|
|
|
|
//处理订单
|
|
|
- //wxPayService.processOrder(bodyMap);
|
|
|
+ wxPayService.processOrder(bodyMap);
|
|
|
|
|
|
//应答超时
|
|
|
//模拟接收微信端的重复通知
|
|
|
- TimeUnit.SECONDS.sleep(3);
|
|
|
+ TimeUnit.SECONDS.sleep(5);
|
|
|
|
|
|
//成功应答
|
|
|
response.setStatus(200);
|
|
@@ -129,7 +126,6 @@ public class WxPayController {
|
|
|
log.info("查询订单");
|
|
|
String result = wxPayService.queryOrder(orderNo);
|
|
|
return Response.ok(result);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@ApiOperation("申请退款")
|
|
@@ -160,7 +156,7 @@ public class WxPayController {
|
|
|
*/
|
|
|
@ApiOperation("退款结果通知")
|
|
|
@PostMapping("/refunds/notify")
|
|
|
- public String refundsNotify(HttpServletRequest request, HttpServletResponse response){
|
|
|
+ public String refundsNotify(HttpServletRequest request, HttpServletResponse response) {
|
|
|
log.info("退款通知执行");
|
|
|
Gson gson = new Gson();
|
|
|
Map<String, String> map = new HashMap<>();//应答对象
|
|
@@ -169,8 +165,8 @@ public class WxPayController {
|
|
|
//处理通知参数
|
|
|
String body = HttpUtils.readData(request);
|
|
|
Map<String, Object> bodyMap = gson.fromJson(body, HashMap.class);
|
|
|
- String requestId = (String)bodyMap.get("id");
|
|
|
- log.info("支付通知的id ===>"+ requestId);
|
|
|
+ String requestId = (String) bodyMap.get("id");
|
|
|
+ log.info("支付通知的id ===>" + requestId);
|
|
|
|
|
|
//签名的验证
|
|
|
if(false){
|