From 6b694c9c9495537291409c61dab3107e05c0e11a Mon Sep 17 00:00:00 2001 From: t0ng7u Date: Tue, 3 Feb 2026 00:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A6=20fix:=20guard=20epay=20return=20s?= =?UTF-8?q?uccess=20on=20order=20completion=20Redirect=20subscription=20re?= =?UTF-8?q?turn=20flow=20to=20failure=20when=20order=20completion=20fails,?= =?UTF-8?q?=20preventing=20false=20success=20states=20after=20payment=20ve?= =?UTF-8?q?rification.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/subscription_payment_epay.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controller/subscription_payment_epay.go b/controller/subscription_payment_epay.go index a0f29cde6..41483af76 100644 --- a/controller/subscription_payment_epay.go +++ b/controller/subscription_payment_epay.go @@ -162,7 +162,10 @@ func SubscriptionEpayReturn(c *gin.Context) { if verifyInfo.TradeStatus == epay.StatusTradeSuccess { LockOrder(verifyInfo.ServiceTradeNo) defer UnlockOrder(verifyInfo.ServiceTradeNo) - _ = model.CompleteSubscriptionOrder(verifyInfo.ServiceTradeNo, common.GetJsonString(verifyInfo)) + if err := model.CompleteSubscriptionOrder(verifyInfo.ServiceTradeNo, common.GetJsonString(verifyInfo)); err != nil { + c.Redirect(http.StatusFound, system_setting.ServerAddress+"/console/subscription?pay=fail") + return + } c.Redirect(http.StatusFound, system_setting.ServerAddress+"/console/subscription?pay=success") return }