Code Monkey home page Code Monkey logo

Comments (8)

driesvints avatar driesvints commented on June 13, 2024 1

Hey everyone. The reason why subscribed is returning true is that the subscription might be deleted but it's on its cancellation grace period (see the date in the "ends_at" column).

If you want to immediately cancel a subscription you need to use ->cancelNow. See the docs here: https://laravel.com/docs/8.x/cashier-paddle#cancelling-subscriptions

from cashier-paddle.

driesvints avatar driesvints commented on June 13, 2024

Hi there,

Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.

from cashier-paddle.

lvismer avatar lvismer commented on June 13, 2024

@driesvints For me I also have a deleted subscription in my subscriptions table but a call to $user->subscriptions()->active()->get() returns that subscription. I would have expected active() to only return a valid subscription. Does the implementation consider a deleted subscription still active?

from cashier-paddle.

Benoit1980 avatar Benoit1980 commented on June 13, 2024

The problem is that some subscriptions in certain systems carries on after the cancellation while others need to be partially refunded(like in mine) or you get extra API call cost(or proxy usage and so on). In my case, the subscription when deleted, if cannot be active. I had to modify the code for my case. This is why I was confused when I saw that a deleted subscription was still considered active.

from cashier-paddle.

techguydev avatar techguydev commented on June 13, 2024

I am having the same problem, what is the best way to go around with this ?, how can we make sure that the user has an active subscription after all even if it was cancelled ?

from cashier-paddle.

Benoit1980 avatar Benoit1980 commented on June 13, 2024

This is how it works at the moment:

        if ($user->subscribed('default')) {
            logger('true');
        }else{
            logger('false');
        }

If the subscription has been cancelled, it will still return true until the date reaches the last day of the subscription(ends_at column). In your case, it is fine.

from cashier-paddle.

driesvints avatar driesvints commented on June 13, 2024

This is also the same reason why the active scope still returns the subscription. It's still an active subscription until its grace period has passed. This works the same in Cashier Stripe.

from cashier-paddle.

Maarondesigns avatar Maarondesigns commented on June 13, 2024

Thanks @driesvints! I was having the same problem and that solved it for me.

I had a subscription that was canceled in Stripe and the webhook didn't update the subscription on my local dev environment, so I manually updated the stripe_status field to "canceled" and was really frustrated why $user->subscription('default')->ended() and $user->subscription('default')->canceled() were both still returning false. I guess the ends_at field is really the only one that matters. The stripe_status is really just a user friendly string in case you want to display it to the end user.

from cashier-paddle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.