From 5a8613f85b8592ebd4a52ba524422261b38d7bed Mon Sep 17 00:00:00 2001 From: scorpiotzh <835598264@qq.com> Date: Thu, 23 Nov 2023 11:49:04 +0800 Subject: [PATCH] feat: fix nil err --- http_svr/handle/payment_info.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http_svr/handle/payment_info.go b/http_svr/handle/payment_info.go index c39100b..1158e85 100644 --- a/http_svr/handle/payment_info.go +++ b/http_svr/handle/payment_info.go @@ -90,7 +90,7 @@ func (h *HttpHandle) doPaymentInfo(req *ReqPaymentInfo, apiResp *http_api.ApiRes RefundStatus: v.RefundStatus, } if v.PayTokenId == tables.PayTokenIdStripeUSD { - if pi, err := stripe_api.GetPaymentIntent(v.PayHash); err == nil { + if pi, err := stripe_api.GetPaymentIntent(v.PayHash); err == nil && pi.PaymentMethod != nil { if pm, err := stripe_api.GetPaymentMethod(pi.PaymentMethod.ID); err == nil { tmp.SourcePayment = fmt.Sprintf("%s %s", pm.Card.Brand, pm.Card.Last4) }