diff --git a/controller/topup.go b/controller/topup.go index a6445b40d68..c20307acd5e 100644 --- a/controller/topup.go +++ b/controller/topup.go @@ -207,7 +207,11 @@ func RequestEpay(c *gin.Context) { } callBackAddress := service.GetCallbackAddress() - returnUrl, _ := url.Parse(system_setting.ServerAddress + "/console/log") + returnPath := "/console/log" + if common.GetTheme() == "default" { + returnPath = "/usage-logs" + } + returnUrl, _ := url.Parse(system_setting.ServerAddress + returnPath) notifyUrl, _ := url.Parse(callBackAddress + "/api/user/epay/notify") tradeNo := fmt.Sprintf("%s%d", common.GetRandomString(6), time.Now().Unix()) tradeNo = fmt.Sprintf("USR%dNO%s", id, tradeNo) diff --git a/controller/topup_stripe.go b/controller/topup_stripe.go index ceee8ecdd66..631932b52a7 100644 --- a/controller/topup_stripe.go +++ b/controller/topup_stripe.go @@ -346,12 +346,18 @@ func genStripeLink(referenceId string, customerId string, email string, amount i stripe.Key = setting.StripeApiSecret - // Use custom URLs if provided, otherwise use defaults + // Use custom URLs if provided, otherwise use defaults based on the active frontend theme + successPath := "/console/log" + cancelPath := "/console/topup" + if common.GetTheme() == "default" { + successPath = "/usage-logs" + cancelPath = "/wallet" + } if successURL == "" { - successURL = system_setting.ServerAddress + "/console/log" + successURL = system_setting.ServerAddress + successPath } if cancelURL == "" { - cancelURL = system_setting.ServerAddress + "/console/topup" + cancelURL = system_setting.ServerAddress + cancelPath } params := &stripe.CheckoutSessionParams{