We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm getting the following exception message when I try to use trialDays(2) on checkout subscription.
The trial_end date has to be at least 2 days in the future.
trial_end
After some research I find that there is 3s difference between API request timestamp in stripe error log and 'trial_end' parameter.
$trial_checkout = $user->newSubscription('default', config('app.stripe_price_id'))->trialDays(2)->checkout($redirects);
The text was updated successfully, but these errors were encountered:
That's odd since there's a failsafe for this right here which provides exactly 2 days of trial time at a minimum: https://github.com/laravel/cashier-stripe/blob/12.x/src/SubscriptionBuilder.php#L373-L378
I wonder if we should add like a minute of extra time for the API request delay. Can you try to see if the following works for you?
$trial_checkout = $user->newSubscription('default', config('app.stripe_price_id')) ->trialDays(Carbon::now()->addDays(2)->addMinute()) ->checkout($redirects);
Sorry, something went wrong.
That's odd since there's a failsafe for this right here which provides exactly 2 days of trial time at a minimum: https://github.com/laravel/cashier-stripe/blob/12.x/src/SubscriptionBuilder.php#L373-L378 I wonder if we should add like a minute of extra time for the API request delay. Can you try to see if the following works for you? $trial_checkout = $user->newSubscription('default', config('app.stripe_price_id')) ->trialDays(Carbon::now()->addDays(2)->addMinute()) ->checkout($redirects);
Yes I managed to resolve the issue by adding 10 seconds.
$trial_checkout = $user->newSubscription('default', config('app.stripe_price_id')) ->trialUntil(Carbon::now()->addDays(2)->addSeconds(10))->checkout($redirects);
Sent in #1160 for this
No branches or pull requests
Description:
I'm getting the following exception message when I try to use trialDays(2) on checkout subscription.
After some research I find that there is 3s difference between API request timestamp in stripe error log and 'trial_end' parameter.
My code snippet that produces this error:
The text was updated successfully, but these errors were encountered: