-
Notifications
You must be signed in to change notification settings - Fork 42
Conversation
Now this makes sense. Care to give a thought @boryn ? |
This should also fix #74 because you can only have one thing, trial or subscription, they will not collide. |
Could you prepare a beta v5 release? Would be much easier to give it a try |
I'm afraid that would be not possible, it would mean I'd have to merge this PR, you can use the branch this PR is on: https://github.com/bpuig/laravel-subby/tree/new_trial_behaviour |
OK |
Thank you for this implementation, seems to be much more logical. I share my first thoughts: "Outside" mode
"Inside" mode
Shouldn't Free plan
Universal information about end of trial/subscription
public function getPeriodEndsAtAttribute()
{
if ($this->isOnTrial()) {
return $this->trial_ends_at;
}
return $this->ends_at;
} |
Wrong function name
* Refactor function * Do not check if usage has expired * Deny record if cannot use * Update docs
Sorry for all that commits, I don't know what happened. |
So how does it work now? Upon renewal,
I don't understand "Trial means you just get free time, not features". Companies often give 7-day trial for the "Pro" plan and allow users both to have time and to test the features for free. I rather see this scenario. And later when you subscribe, you get fresh set of features. Maybe it should be on an option then?
But should I (developer) care about refreshing it every month? Normally renewal comes "from outside" (payment). When we set a free 0€ subscription, it is not natural that we additionaly should care about prolonging it every month. It just should be infinite. |
Do you have an idea how to solve it? I think we need a check whether a date is inside a subscription period and if Buuuut... then feature usage is not decoupled from subscriptions... And sub period can be a year, and feature a month... Maybe there should be a loop for incrementing valid_until = valid_until + resettable period (of course when valid_until is already in current period, there is no loop necessary) |
Wait... You already solved it at e335d97 ! Funny thing that we came to the same conclusion of doing it in a loop :) |
Trial ends at
Then you are giving a month set of features for free, do you really want that? I can look into making it an option, makes sense, not economically, but makes sense... 😆
Subscriptions should auto-renew until canceled. I know there is the payment thing that should be sorted sometime, but right now the package is a "bubble" that should not care what happens in the outside world (payment platform). |
# Conflicts: # src/SubbyServiceProvider.php # src/Traits/HasSubscriptions.php
…into new_trial_behaviour � Conflicts: � src/SubbyServiceProvider.php
Sometimes you need to give a user something totally for free (even the Pro "sub") so that they get to know your solution and only later ask them to pay. If the trial is longer, eg. for 30 days and they later prolong, they need to have fresh usage limits. And even if trial is 7-14 days, when they decided to prolong, they get a new subscription and in my opinion, they need to get fresh usage limits as well. I consider a free trial to be a real free trial. So I think, it would be good implementing such an option.
Hmm... So I was not aware of the auto-renewal of free subscriptions. Where does it happen in the code? |
I'll try to implement the behavior somehow 👍
I meant YOU need to auto-renew the subscriptions. The package was (is) thought that you handle renewals when subscription ends, and you should keep track of renewals. |
That's natural that subscriptions with the price need to have the outside event to trigger the renewal. But the free subscriptions don't even demand the outside world, they should just exist and be available. And that's why I talk about some special handling of the free subscriptions, inside the package "bubble" itself. AFAIR this manual renewing of free subscriptions is not mentioned in the docs? Or I didn't notice that. Common sense tells me that if the subscription is free, it's just can be used forever and no external steps need to be taken. It would be a big nuisance to set up an extra scheduler job just to keep free subs "alive". IMHO it would be reasonable to fill the |
I think this is almost good to go. I have been away for some time so I'm not fully fresh about what we were talking. This branch accepts renewal by periods. Also renewal does not clear usage just manipulates periods, since that is done by the usage model automatically. If you want to take a look at it, I'll live it open some more time in case I find anything more. Exceptions for free subscriptions will not be made, they will be treated as a regular subscription with 0 price. This will keep the package more coherent and with the minimum exceptions and variants possible as long as it is usable. 😄 |
Thank you! I hope to be able to test it the next week and will give some feedback |
Discarded #75, now this is a bit simpler.
New behavior
Trial modes
There are two available trial modes:
inside
oroutside
. This defines how the trial will be counted when renewal timeis due. Also renewal only affects subscription period, it can be renewed for as many periods as you want.
USAGE WILL NOT BE CLEARED when user has had trial time. This is what gives sense to both methods. If you need to clear, you can do it manually upon renewal.
When a new subscription to a plan is made:
If plan has trial
If plan has trial, subscriber does not have subscription but only a trial. Subscription period starts and ends at
null
and this is considered subscription is not made. Because in a real case scenario, when a subscriber has a trial it does not have a subscription yet, so the invoice period is made and charged after the trial has ended.Renewal when trial is "inside"
If trial mode is
inside
; when trial ends and is renewed invoice period will have substracted the days of trial that have been used.Example: 7 day trial in a 30 day subscription period.
In summary: this is NOT a free trial. User always ends up paying the full price for full period.
Renewal when trial is "outside"
If trial mode is
outside
; when trial ends and is renewed, invoice period will start at the moment it's renewed.Example: 7 day trial in a 30 day subscription period.
renewal will be in 30 days. User got 7 days for free.
In summary: this is IS a free trial. User does not pay for the trial period, but for the next subscription period.
If plan does not have trial
If plan does not have trial, subscriber has subscription. Because when a plan does not have trial, a new subscription activates a new invoicing period.
TODO: