Skip to content

Commit

Permalink
Handle stripe subscription line items having multiple
Browse files Browse the repository at this point in the history
Seems like stripe subscription products have both monthly and yearly listed in the line items of the event
  • Loading branch information
StevenWeathers committed Mar 31, 2024
1 parent 4aa73a1 commit 41e78f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/webhook/subscription/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (s *Service) HandleWebhook() http.HandlerFunc {
w.WriteHeader(http.StatusBadRequest) // Return a 400 error on a bad signature
return
}
if cs.LineItems == nil || len(cs.LineItems.Data) != 1 {
if cs.LineItems == nil || len(cs.LineItems.Data) < 1 {
logger.Error("Error getting subscription product from event", zap.String("eventId", event.ID),
zap.String("sessionId", cs.ID))
w.WriteHeader(http.StatusBadRequest) // Return a 400 error on a bad signature
Expand Down

0 comments on commit 41e78f1

Please sign in to comment.