[WIP] Clarify the difference in active vs valid states #511
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.
Been using this on my latest project and found it fantastic to work with.
One hurdle I ran into was understanding the difference in
active()vsvalid()states for subscriptions. In trying to understand them I made this:onTrial()active()valid()cancelled()onGracePeriod()Unless I am missing a potential state a subscription can be in - it seems that these methods will always return the same thing. The tests in this PR also pass - which confirm the results in the table.
My thinking is that an "active" subscription is one that you are going to make money off - i.e. it is going to renew.
A "valid" subscription is any subscription that has not ended, i.e. all active subscriptions and all subscriptions on a grace period.
Unless I'm missing something else - I think it would be good to fix the methods in the package and adjust the PR'd tests to match.
If you agree with my thinking let me know and I'll submit the fixes for you - otherwise I'm more than happy to adjust with your guidance on what
activevsvalidmeans to Cashier.This has been submitted to
masteras I am unsure if the fix (if wanted) would be a breaking change or a bug fix.