Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@RequestMapping("/notifies")
public class Notifies {

private static final Logger logger = LoggerFactory.getLogger(Notifies.class);
private static final Logger LOGGER = LoggerFactory.getLogger(Notifies.class);

@Autowired
private AlipayService alipayService;
Expand All @@ -39,9 +39,9 @@ public String backend(HttpServletRequest request){
for (AlipayField f : AlipayFields.WEB_PAY_NOTIFY){
notifyParams.put(f.field(), request.getParameter(f.field()));
}
logger.info("backend notify params: {}", notifyParams);
LOGGER.info("backend notify params: {}", notifyParams);
if (!alipayService.notifyVerifyMd5(notifyParams)){
logger.error("backend sign verify failed");
LOGGER.error("backend sign verify failed");
return "FAIL";
}

Expand All @@ -52,7 +52,7 @@ public String backend(HttpServletRequest request){
// TODO business logic
}

logger.info("backend notify success");
LOGGER.info("backend notify success");
return "SUCCESS";
}

Expand All @@ -76,8 +76,8 @@ public String webFrontend(HttpServletRequest request){
// TODO business logic
}

logger.info("web frontend notify params: {}", receives);
logger.info("web frontend sign: {}", alipayService.notifyVerifyMd5(receives));
LOGGER.info("web frontend notify params: {}", receives);
LOGGER.info("web frontend sign: {}", alipayService.notifyVerifyMd5(receives));

return receives.toString();
}
Expand All @@ -102,8 +102,8 @@ public String wapFrontend(HttpServletRequest request){
// TODO business logic
}

logger.info("wap frontend notify params: {}", receives);
logger.info("wap frontend sign: {}", alipayService.notifyVerifyMd5(receives));
LOGGER.info("wap frontend notify params: {}", receives);
LOGGER.info("wap frontend sign: {}", alipayService.notifyVerifyMd5(receives));

return receives.toString();
}
Expand All @@ -120,15 +120,15 @@ public String refund(HttpServletRequest request){
receives.put(f.field(), request.getParameter(f.field()));
}

logger.info("refund notify params: {}", receives);
LOGGER.info("refund notify params: {}", receives);
if (!alipayService.notifyVerifyMd5(receives)){
System.out.println("refund sign verify failed");
return "FAIL";
}

// TODO business logic

logger.info("refund notify success");
LOGGER.info("refund notify success");
return "SUCCESS";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@RequestMapping("/pays")
public class Pays {

private static final Logger logger = LoggerFactory.getLogger(Pays.class);
private static final Logger LOGGER = LoggerFactory.getLogger(Pays.class);

@Autowired
private AlipayService alipayService;
Expand All @@ -35,7 +35,7 @@ public void webPay(@RequestParam("orderNumber") String orderNumber, HttpServletR

WebPayDetail detail = new WebPayDetail(orderNumber, "测试订单-" + orderNumber, "0.01");
String form = alipayService.webPay(detail);
logger.info("web pay form: {}", form);
LOGGER.info("web pay form: {}", form);
try {
resp.setContentType("text/html;charset=UTF-8");
resp.setCharacterEncoding("UTF-8");
Expand All @@ -54,7 +54,7 @@ public void wapPay(@RequestParam("orderNumber") String orderNumber, HttpServletR

WapPayDetail detail = new WapPayDetail(orderNumber, "测试订单-" + orderNumber, "0.01");
String form = alipayService.wapPay(detail);
logger.info("wap pay form: {}", form);
LOGGER.info("wap pay form: {}", form);
try {
resp.setContentType("text/html;charset=UTF-8");
resp.setCharacterEncoding("UTF-8");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@RequestMapping("/refunds")
public class Refunds {

private static final Logger logger = LoggerFactory.getLogger(Refunds.class);
private static final Logger LOGGER = LoggerFactory.getLogger(Refunds.class);

@Autowired
private AlipayService alipayService;
Expand All @@ -47,7 +47,7 @@ public Boolean submit(
data.setFee("0.01");
data.setReason("订单取消");
detail.setDetailDatas(Arrays.asList(data));
logger.info("refund submit: {}", detail);
LOGGER.info("refund submit: {}", detail);
return alipayService.refund(detail);
}
}