|
|
@@ -48,8 +48,13 @@ public class AlipayController {
|
|
|
this.tradeService = tradeService;
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/testPay")
|
|
|
+ public Response testPay(@RequestBody PayModelDTO payModelDTO){
|
|
|
+ System.out.println("testPay开始");
|
|
|
+ return new SuccessResponse();
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/pay")
|
|
|
- @RootAllowed
|
|
|
public Response pay(@RequestBody PayModelDTO payModelDTO) throws AlipayApiException, IOException {
|
|
|
Order order=orderService.createOrder(payModelDTO.getUserId(),payModelDTO.getProductId(),payModelDTO.getPlatformType(),payModelDTO.getPrice());
|
|
|
if (order==null)
|
|
|
@@ -72,6 +77,7 @@ public class AlipayController {
|
|
|
// 调用SDK生成表单, 并直接将完整的表单html输出到页面
|
|
|
AlipayTradePagePayResponse alipayTradePagePayResponse=alipayClient.pageExecute(pagePayRequest);
|
|
|
if (alipayTradePagePayResponse.isSuccess()){
|
|
|
+ System.out.println(alipayTradePagePayResponse.getBody());
|
|
|
return new SuccessResponse(alipayTradePagePayResponse.getBody());
|
|
|
}else {
|
|
|
order.setStatus(OrderStatus.FAILED);
|
|
|
@@ -82,6 +88,7 @@ public class AlipayController {
|
|
|
|
|
|
@RequestMapping("/notify")
|
|
|
public String notify(HttpServletRequest request) throws AlipayApiException, UnsupportedEncodingException {
|
|
|
+ System.out.println("notify开始");
|
|
|
// 一定要验签,防止黑客篡改参数
|
|
|
Map<String, String[]> parameterMap = request.getParameterMap();
|
|
|
StringBuilder notifyBuild = new StringBuilder("/****************************** alipay notify ******************************/\n");
|