From 3985f4f744417fedcd79add1db7caa3b0e6f769b Mon Sep 17 00:00:00 2001 From: wolter <11@gmail> Date: Mon, 12 Jan 2026 18:51:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=B6=E9=93=B6=E5=8F=B0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/third/paymentService/wechat_service.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/third/paymentService/wechat_service.go b/app/third/paymentService/wechat_service.go index 16226e8..b51dbb5 100644 --- a/app/third/paymentService/wechat_service.go +++ b/app/third/paymentService/wechat_service.go @@ -260,8 +260,12 @@ func WxOrderQuery(ctx context.Context, wxConfig WxPay, orderNo string) (PayOrder case "CLOSED": tradeState = "CLOSED" } - amountTotal := wxRsp.Response.Amount.Total - payerTotal := wxRsp.Response.Amount.PayerTotal + amountTotal := 0 + payerTotal := 0 + if wxRsp.Response.Amount != nil { + amountTotal = wxRsp.Response.Amount.Total + payerTotal = wxRsp.Response.Amount.PayerTotal + } outTradeNo, _ := strconv.Atoi(wxRsp.Response.OutTradeNo) return PayOrderQueryInfo{