bpuig / laravel-subby

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

`syncPlan` should / could not renew the subscription #98

Closed boryn closed 3 years ago

boryn commented 3 years ago

I wanted to set the new plan to the subscription (before payment). And I have just noticed that when I wanted to syncPlan with $syncInvoicing = true for saving the new payment period I have noticed that with these lines:

// Set new start and end date
$period = new Period($plan->invoice_interval, $plan->invoice_period);

$this->starts_at = $period->getStartDate();
$this->ends_at = $period->getEndDate();

the subscription actually gets renewed. IMHO I would keep changing plan and the renewal separate. So syncPlan and changePlan should not automatically renew the sub, or do it optionally with an argument.

bpuig commented 3 years ago

I see, it makes sense. Fixed in 6cb06fd50312159225507b596aa018f40ab54627