lucasdotvin/laravel-soulbscription

Renew functions doubles the remaining months instead of adding periodicity.

GL1TCH1337 opened this issue · 2 comments

I want to have a system like if user has no subs subscribe but if he have extend it. But with this code. It goes like this. On first use it extends 1 month. After second run it extends 2 after 4 and it goes like this. Every time he extends remaining time doubles itself.

``

    $plan = \LucasDotVin\Soulbscription\Models\Plan::find(1);

    $subs = \auth()->user()->subscription;
    if(!$subs){
        \auth()->user()->subscribeTo($plan);
    }else{
       $subs->renew();
    }

``

Hey! Thanks for reporting the bug! This is a very weird behavior. 🧐 I'll make some tests and try to find the root cause for that.

Hi @lucasdotvin Have you had time to check this behavior? if not I can run a quick test, and then send a pull request.