bpuig / laravel-subby

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

Still true `isOnTrial()` even if paid (renewed) #66

Closed boryn closed 3 years ago

boryn commented 3 years ago

Scenario: User registers, gets trial subscription upon registration and soon (after 1 minute or 1 day) pays and prolongs subscription.

The $subscription->renew() prolongs his ends_at but does not delete the trial_ends_at. And checking $user->subscription('main')->isOnTrial() returns true which in my opinion is erroneous.

Similarly, PlanSubscription::findEndingTrial(10)->get() returns this freshly renewed subscription which could cause problems when we'd like to send some reminding emails to the users on trials.

bpuig commented 3 years ago

Fixed in #68