code: @RequestMapping("/backend")
      public String backend(HttpServletRequest request){
          Map<String, String> notifyParams = new HashMap<>();
  
          // TODO 这里还是建议直接从request中获取map参数，兼容支付宝修改或增减参数
          for (AlipayField f : AlipayFields.WEB_PAY_NOTIFY){
              notifyParams.put(f.field(), request.getParameter(f.field()));
          }
          logger.info("backend notify params: {}", notifyParams);
          if (!alipayService.notifyVerifyMd5(notifyParams)){
              logger.error("backend sign verify failed");
              return "FAIL";
          }
  
          String tradeStatus = notifyParams.get(AlipayField.TRADE_STATUS.field());
          if (TradeStatus.TRADE_FINISHED.value().equals(tradeStatus)
                  || TradeStatus.TRADE_SUCCESS.value().equals(tradeStatus)){
              // 交易成功
              // TODO business logic
          }
  
          logger.info("backend notify success");
          return "SUCCESS";
      }
docs: 支付宝服务器通知