bpuig / laravel-subby

Laravel Plan and Subscriptions manager.
https://bpuig.github.io/laravel-subby
MIT License
102 stars 42 forks source link

Grace period #79

Closed boryn closed 2 years ago

boryn commented 3 years ago

(I'll share some more thoughts regarding the upcoming new v5 version)

I saw you decided to remove the grace period fields because as I understood they had no coverage in the code?

But IMHO it would be good to implement the functionality of the grace period. There are situations where people want to continue with our app, but there were some issues with their card (expired, stolen, used daily limit, etc.) they could be even unaware of. Until we try to charge the money, neither we or the user know about the problem.

And when this situation arises, we should give them some grace_period (always expressed in days?) to solve the issue with the card and not abruptly stop access to the app/features.

I think using of grace period should only modify the behaviour of isActive() and not hasEnded(). Maybe an extra method like isInGracePeriod() could be useful as well.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

boryn commented 3 years ago

I think it would be great to have the grace period in the upcoming v5. What are your thoughts @bpuig?

bpuig commented 3 years ago

Are you thinking per plan or global config?

boryn commented 3 years ago

Global config could be useful, but probably would not be enough. I see its behaviour similar to features, so that grace period is defined in the plan and copied to plan_subscriptions. I mean that the majority of customers can have for example, the default 3 days of grace period, but some can have exceptions of 5 or 10 days.

bpuig commented 2 years ago

Done!