Skip to content

Commit

Permalink
Use the right logic in the webhook handler
Browse files Browse the repository at this point in the history
  • Loading branch information
jveski committed Jun 19, 2024
1 parent 5383af4 commit 1b85478
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions internal/server/stripe.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@ func (s *Server) newStripeCheckoutHandler() http.HandlerFunc {
renderSystemError(w, "error while getting user from Keycloak: %s", err)
return
}
extended, err := s.Keycloak.ExtendUser(r.Context(), user)
if err != nil {
renderSystemError(w, "error while extending user with Keycloak: %s", err)
return
}

// If there is an active payment on record for this user, start a session to manage the subscription.
if extended.ActiveMember {
if user.StripeCustomerID != "" {
sessionParams := &stripe.BillingPortalSessionParams{
Customer: stripe.String(user.StripeCustomerID),
ReturnURL: stripe.String(s.Env.SelfURL + "/profile"),
Expand Down

0 comments on commit 1b85478

Please sign in to comment.