Expected behavior for price changes
You may want to raise your price for new customers while old customers remain at their current price. Ine Stripe, you create a new price for a product and archive the old one. Your current customers will remain at that price but new subscriptions cannot be created with that price ID.
Then, in Wave, I edited my plans to reflect the new price ID's. When a customer's monthly subscription renewed, an exception was thrown in StripeWebhook.php on line 60. That's because on the line above $updatedPlan = Plan::where($plan_price_column, $stripeSubscription->plan->id)->first(); returns null because that old price ID no longer exists.
In order to fix this issue, I had to recreate the old price values in the plan, mark it inactive, then create a new plan with the new price ID. Then the subscription updated succeeded.
Is this the expected behavior? This will result at some point in the future lots of inactivated plans at old price points filling the table. Maybe that's OK.
Otherwise, perhaps instead of finding plans by price ID, include the product ID as a column in the plan table, which remains constant regardless if you change the price. Then look up plan with $updatedPlan = Plan::where($plan_product_id, $stripeSubscription->plan->product)->first(); instead. Thoughts?