杨杰 4 vuotta sitten
vanhempi
commit
75823b1d6a

+ 1 - 1
src/main/java/com/llisoft/pay/controller/AliPayController.java

@@ -32,7 +32,7 @@ public class AliPayController {
 	
 	@ApiOperation(value="同步回调")
 	@GetMapping("/return")
-	public String retur(HttpServletRequest request) throws Exception {
+	public String returns(HttpServletRequest request) throws Exception {
 		Map<String, String> resultMap = this.getParamMap(request);
 		logger.debug("收到支付宝同步回调: {}", resultMap);
 		return "redirect:" + aliPayService.doReturn(resultMap);

+ 6 - 1
src/main/java/com/llisoft/pay/service/AppService.java

@@ -49,7 +49,12 @@ public class AppService {
 	 */
 	@Async
 	public void notify(int appId, String orderNum, String body) {
-		String notifyUrl = this.packUrl(appDao.select(appId).getNotifyUrl(), orderNum);
+		App app = appDao.select(appId);
+		String notifyUrl = this.packUrl(app.getNotifyUrl(), orderNum);
+		if(Objects.isNull(notifyUrl) || notifyUrl.trim().isEmpty()) {
+			logger.debug("未配置异步通知地址:{} : {}", app.getAppKey(), app.getAppName());
+			return;
+		}
 		logger.debug("异步通知: 请求地址: {}, 参数: {}", notifyUrl, body);
 		String result = HttpUtil.postJson(notifyUrl, body);
 		logger.debug("异步通知: 返回信息: {}", result);