Skip to content

Commit

Permalink
fix: add phase reason cancel if schedule end behavior is cancel (#685)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbh authored Jul 24, 2024
1 parent 0381894 commit 2e297c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions billing/subscription/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ func (s *Service) SyncWithProvider(ctx context.Context, customr customer.Custome
if sub.Phase.PlanID != nextPlanID {
sub.Phase.PlanID = nextPlanID
sub.Phase.Reason = SubscriptionChange.String()

if stripeSchedule.EndBehavior == stripe.SubscriptionScheduleEndBehaviorCancel {
sub.Phase.Reason = SubscriptionCancel.String()
}

updateNeeded = true
}
if stripeSubscription.Schedule != nil {
Expand Down

0 comments on commit 2e297c7

Please sign in to comment.