From 4d9d702c2124898e9955cf98531b1e01e2e8466f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 23 Sep 2024 21:08:29 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E6=94=AF=E4=BB=98=EF=BC=9A=E4=BC=98=E5=8C=96=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=AE=9D=E3=80=81=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=94=AF=E4=BB=98=E7=BB=93=E6=9E=9C=E5=92=8C?= =?UTF-8?q?=E5=BC=82=E6=AD=A5=E5=9B=9E=E8=B0=83=E7=BB=93=E6=9E=9C=E7=9A=84?= =?UTF-8?q?=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/pay/service/order/PayOrderServiceImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java index 1111daa26..987c2280c 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java @@ -163,7 +163,14 @@ public class PayOrderServiceImpl implements PayOrderService { // 4. 如果调用直接支付成功,则直接更新支付单状态为成功。例如说:付款码支付,免密支付时,就直接验证支付成功 if (unifiedOrderResp != null) { - getSelf().notifyOrder(channel, unifiedOrderResp); + try { + getSelf().notifyOrder(channel, unifiedOrderResp); + } catch (Exception e) { + // 兼容 https://gitee.com/zhijiantianya/yudao-cloud/issues/I8SM9H 场景 + // 支付宝或微信扫码之后时,由于 PayClient 是直接返回支付成功,而支付也会有回调,导致存在并发更新问题,此时一般是可以 try catch 直接忽略 + log.warn("[submitOrder][order({}) channel({}) 支付结果({}) 通知时发生异常,可能是并发问题]", + order, channel, unifiedOrderResp, e); + } // 如有渠道错误码,则抛出业务异常,提示用户 if (StrUtil.isNotEmpty(unifiedOrderResp.getChannelErrorCode())) { throw exception(PAY_ORDER_SUBMIT_CHANNEL_ERROR, unifiedOrderResp.getChannelErrorCode(),