This repository has been archived by the owner on Jan 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
control: rework subscription and schedule approach (#218)
This changes the scheduling logic to consider the subscription as the source of truth, rather than trying to force the schedule API into being it. The new approach drastically simplifies the ability to reason about how Tier converts a single timeline into the complex beast that is Stripe schedules and subscription schedules because we can now say that: All schedule reads are done through subscriptions via the active subscription's current "schedule," and all schedules are created and updated via schedules. Create: Schedule API creates the subscription. Updates: The schedule API updates the subscription. Reads: The subscription API shows the current state, including the current current subscription schedule This also relaxes constraints for canceling phases. Previous to this commitment, cancellations have to go into effect immediately. Now cancel phases may appear in multi-phase schedules where the canceling happens in the future. The new restriction is that they are the last phase. The new "last phase" restriction may be relaxed in the future by canceling the current schedule as it does now but then creating a new subscription schedule, scheduled in the future. This also adds the ability to update default payment information for a stripe. customer via OrgInfo.
- Loading branch information
Showing
10 changed files
with
296 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.