Closed estevao-simoes closed 3 months ago
Hey there,
Unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? If so, please open up a new issue and we'll help you out.
Thanks!
Cashier Stripe Version
14.14.0
Laravel Version
10.48.13
PHP Version
8.3
Database Driver & Version
MySQL v8
Description
I have a SaaS running cashier with stripe. I noticed on stripe a customer being active, but on my app, he was inactive.
When analyzing the Billable model's return for
$user->subscribed('default');
, it came back false. That meant the user was not subscribed, although Stripe was clear on showing me the last bill was paid and the user had an active subscription.After further investigation, I noticed the user had more than one subscription in the database, all of them up to date with stripe. No webhook problems. 3 where canceled, and one active.
This is probably an edge case, but when a billable model has more than one subcription on the database, and only one is active, the
subscribed()
function can return false, despite there beign an active subscription.The issue, as far as i can tell, lies on the following code:
first()
is called, not taking in account thestripe_status
, so if the user has more than one subscription, the first one is returned, no matter the status.Let me know if I implemented cashier wrong. Reporting in case this is something important or not previously reported.
Thanks in advance for all the amazing work.
Steps To Reproduce
stripe_status
marked as activesubscribed
on the billable model