From e4e43feaf23209b3a2d707cdf28103807584c209 Mon Sep 17 00:00:00 2001 From: wolter <11@gmail> Date: Mon, 24 Aug 2026 19:03:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(thirdpay):=20=E5=A4=84=E7=90=86=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E7=BB=93=E6=9E=9C=E4=B8=BAFAIL=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=E5=B9=B6=E6=96=B0=E5=A2=9E=E6=9C=AA=E7=9F=A5=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增支付状态FAIL的分支处理,将对应订单置为失败状态,同时新增未知支付状态的日志记录和失败返回逻辑 --- app/services/thirdpay/pay_query.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/services/thirdpay/pay_query.go b/app/services/thirdpay/pay_query.go index 1ff5c8a..720c89d 100644 --- a/app/services/thirdpay/pay_query.go +++ b/app/services/thirdpay/pay_query.go @@ -77,6 +77,13 @@ func OrderQueryAndNotify(ctx context.Context, orderInfo *ordersmodel.OrdersLeftP // 关闭 status = common.ORDER_STATUS_CLOSE msg = "订单关闭" + case "FAIL": + // 失败 + status = common.ORDER_STATUS_FAILED + default: + utils.Log(nil, "支付状态未知", fmt.Sprintf("id =%d, status=%s", orderInfo.Id, result.Result.TradeState)) + msg = "支付失败" + return } // 回调通知下游 notifyResult := thirdpay_notify.NewOrderNotifyWithHandle(orderInfo.Id, result.Code, status, int(result.Result.AmountTotal), int(result.Result.PayerTotal), msg, result.Result.TransactionId)