bpuig / laravel-subby

Laravel Plan and Subscriptions manager.
https://bpuig.github.io/laravel-subby
MIT License
102 stars 42 forks source link

Update of invoice fields upon changePlan($plan) #51

Closed boryn closed 3 years ago

boryn commented 3 years ago

I have a $plan with invoice_interval of a value 'year'. I do:

$plan::find(2); // the one with `invoice_interval` set to 'year'
$subscription = $user->subscription();
$subscription->changePlan($plan);

After checking the db, I have indeed changed plan_id, price and currency but not invoice_period and invoice_interval fields. As $syncInvoicing is by default true in changePlan() I would expect that invoice_period and invoice_interval got updated as well in the plan_subscriptions table?

The ends_at was properly extended by a year from now.

bpuig commented 3 years ago

You are right. Fixed in 714ba02a71569fb87a8e035f65620b89c55aca7e