Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renew functions doubles the remaining months instead of adding periodicity. #101

Open
GL1TCH1337 opened this issue Apr 20, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@GL1TCH1337
Copy link

GL1TCH1337 commented Apr 20, 2024

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();
    }

``

@lucasdotvin
Copy link
Owner

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.

@lucasdotvin lucasdotvin self-assigned this Apr 24, 2024
@lucasdotvin lucasdotvin added the bug Something isn't working label Apr 24, 2024
@stevebrainng
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants