-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behaviour with onTrial method in Billable #1128
Comments
Happy to suggest a PR |
Are you also using Laravel Spark? |
No, custom build using Cashier directly |
So I first implemented this function here: #1000 and it was later fixed here: #1015 But it indeed seems to not account for your use case. I agree this should be fixed. Although I wouldn't immediately label this as a bug. Depending on the implementation this should go to either the current stable version or master. |
I'll send a PR to master then as it's, although nuanced, a breaking change |
Description:
Not so much a bug as unexpected behaviour from the onTrial method.
I have a snippet of code that does something similar to the following:
The behaviour I would expect is that the
onTrial
andtrialEndsAt
should both check and return the same date & time respectively. The issue in question arises when a user is on a generic trial and has a subscription that isn't on a trial.onTrial
first checks for generic trial if no arguments have been passed through. It then defaults to the subscription nameddefault
and checks that subscription for a trial.trialEndsAt
first checks thedefault
subscription if there are no arguments passed through. If a trial doesn't exist there it falls back to generic trial.The point I am trying to get across is that both
onTrial
andtrialEndsAt
should probably follow similar logic when it comes to checking for trials. PerhapsonTrial
should calltrialEndsAt
?The text was updated successfully, but these errors were encountered: