use of com.albedo.java.common.core.annotation.AnonymousAccess in project albedo by somowhere.
the class AliPayResource method returnPage.
@GetMapping("/return")
@AnonymousAccess
@Operation(hidden = true, summary = "支付之后跳转的链接")
public ResponseEntity<String> returnPage(HttpServletRequest request, HttpServletResponse response) {
AlipayConfigDo alipay = alipayService.find();
response.setContentType("text/html;charset=" + alipay.getCharset());
// 内容验签,防止黑客篡改参数
if (alipayUtils.rsaCheck(request, alipay)) {
// 商户订单号
String outTradeNo = new String(request.getParameter("out_trade_no").getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
// 支付宝交易号
String tradeNo = new String(request.getParameter("trade_no").getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
System.out.println("商户订单号" + outTradeNo + " " + "第三方交易号" + tradeNo);
// 根据业务需要返回数据,这里统一返回OK
return new ResponseEntity<>("payment successful", HttpStatus.OK);
} else {
// 根据业务需要返回数据
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
}
Aggregations