I just upgraded from 10 to 11 on my dev environment.
I started using multiple plans, but I think there may be is a bug :
I added a plan to an existing subscription. However, when I try to check the subscription via subscribedToPlan method, it does not work.
After a bit digging, the issue seems to be :
I still have stripe_plan filled with my intial subscription in my subscriptions table, and I have only one row for that user in my subscription_items table.
So the hasMultiplePlans method returns false, and so hasPlan returns false also.
The issue would be probably solved if I migrate all my current subscriptions to subscription_items table, and then set stripe_plan and qty to null in subscriptions table. But, I don't see any of this on the migration guide, so I guess it should not behave like this ? When adding the second plan, both subscriptions should have been migrated to subscription_items, am I right ?
I'm not sure I'm clear, so here is the situation before/after upgrading :
I think I see what the problem is. Because you indeed don't have the initial subscription items there's a check somewhere that doesn't makes sense. I'll fix this.
Description:
I just upgraded from 10 to 11 on my dev environment. I started using multiple plans, but I think there may be is a bug :
I added a plan to an existing subscription. However, when I try to check the subscription via
subscribedToPlan
method, it does not work. After a bit digging, the issue seems to be : I still havestripe_plan
filled with my intial subscription in mysubscriptions
table, and I have only one row for that user in mysubscription_items
table. So thehasMultiplePlans
method returns false, and sohasPlan
returns false also.The issue would be probably solved if I migrate all my current subscriptions to
subscription_items
table, and then setstripe_plan
and qty to null insubscriptions
table. But, I don't see any of this on the migration guide, so I guess it should not behave like this ? When adding the second plan, both subscriptions should have been migrated tosubscription_items
, am I right ?I'm not sure I'm clear, so here is the situation before/after upgrading :
Before
subscriptions
table :->subscribedToPlan('monthly')
=> returned trueAfter upgrading, and after
->addPlan('option1')
subscriptions
table :subscription_items
table :->subscribedToPlan('monthly')
=> return true->subscribedToPlan('option1')
=> return false->hasMultiplePlans()
=> return false