From fc07c0611aa0e4bcb5b902a0c554e08629cb000b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Fri, 6 Oct 2023 09:37:45 +0200 Subject: [PATCH] chore: allow promo codes during checkout [skip ci] --- routes/subscription.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/routes/subscription.go b/routes/subscription.go index e02131b9..e1898273 100644 --- a/routes/subscription.go +++ b/routes/subscription.go @@ -144,9 +144,10 @@ func (h *SubscriptionHandler) PostCheckout(w http.ResponseWriter, r *http.Reques Quantity: stripe.Int64(1), }, }, - ClientReferenceID: &user.ID, - SuccessURL: stripe.String(fmt.Sprintf("%s%s/subscription/success", h.config.Server.PublicUrl, h.config.Server.BasePath)), - CancelURL: stripe.String(fmt.Sprintf("%s%s/subscription/cancel", h.config.Server.PublicUrl, h.config.Server.BasePath)), + ClientReferenceID: &user.ID, + AllowPromotionCodes: stripe.Bool(true), + SuccessURL: stripe.String(fmt.Sprintf("%s%s/subscription/success", h.config.Server.PublicUrl, h.config.Server.BasePath)), + CancelURL: stripe.String(fmt.Sprintf("%s%s/subscription/cancel", h.config.Server.PublicUrl, h.config.Server.BasePath)), } if user.StripeCustomerId != "" {