Skip to content

Commit

Permalink
Fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jveski committed Jun 19, 2024
1 parent 68abbca commit dd6d91f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/server/stripe.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ 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 user.PaypalSubscriptionID != "" {
if extended.ActiveMember {
sessionParams := &stripe.BillingPortalSessionParams{
Customer: stripe.String(user.StripeCustomerID),
ReturnURL: stripe.String(s.Env.SelfURL + "/profile"),
Expand Down

0 comments on commit dd6d91f

Please sign in to comment.