Add support for past_due subscriptions #1892
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1878
As I originally thought this was going to collide with the changes in #1889 I chose to based this work on the
fix-coupons
branch. In hindsight, I think the changes are somewhat more self-contained so don't strictly need to be based on that branch... but they both need to go in regardless.Description
This adds track of 'past_due' stripe subscriptions. This is the state they go into as soon as a payment has failed.
With this PR, we update our internal state to 'past_due', but we still treat that as 'active' as far as all the billing logic goes. This ensures no change in functionality at this point in time. We may choose to restrict behaviour in the future - but not as part of this PR.
This then allows us to add a banner notifying the user if there is an over due payment:
This also includes a related fix where, when a subscription is canceled and we suspend all projects, we weren't resetting the billing state. This prevented them being re-added to new subscription once setup.
Related Issue(s)
#1878
Checklist
flowforge.yml
?flowforge/helm
to update ConfigMap Templateflowforge/CloudProject
to update values for Staging/ProductionLabels
backport
labelarea:migration
label