Skip to content

Commit

Permalink
chore: allow promo codes during checkout [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
muety committed Oct 6, 2023
1 parent d93af11 commit fc07c06
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions routes/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down

0 comments on commit fc07c06

Please sign in to comment.