Cashier-stripe: SkipTrial on swapping plan issue

Created on 21 Jul 2016  路  3Comments  路  Source: laravel/cashier-stripe

Cashier 6.0.18, Laravel 5.2

According to docs, in order to skip the existent plan's trial before swapping to new plan i call:

$user->subscription('main')->skipTrial()->swap('provider-plan-id');

It seems though, that the skipTrial() method exists in SubscriptionBuilder Class , and not in Subscription.

As a result, if i try the code above i get:

BadMethodCallException in Builder.php line 2345: Call to undefined method Illuminate\Database\Query\Builder::skipTrial()

Which is because i am calling the "skipTrial()" from a Subscription object, not from a SubscriptionBuilder and Subscription model has no such method.

Most helpful comment

I don't believe the swap method actually checks during a swap. It only checks the trial_ends_at field is null via the is onTrial() method. As a temporary workaround I am using the following:

        $subscription = $user->subscription('main');
        $subscription->trial_ends_at = null;
        $subscription->swap($plan);

All 3 comments

I don't believe the swap method actually checks during a swap. It only checks the trial_ends_at field is null via the is onTrial() method. As a temporary workaround I am using the following:

        $subscription = $user->subscription('main');
        $subscription->trial_ends_at = null;
        $subscription->swap($plan);

This is happening to me as well. Went with the workaround @cjke pasted.

Was this page helpful?
0 / 5 - 0 ratings