I would set up a webhook to listen for failed charges, not exactly sure what you would need to do but it could be the right direction.
Cashier creating multiple Stripe customers and upgrading subscription incorrectly
I'm having a couple of problems with Cashier 5.0.15 with Stripe.
Firstly is that if a new subscriber starts a subscription, even if the card fails a customer in Stripe will be created. That's not so much a problem, but the fact that each time their card fails a new customer is created, so if someone's payment fails 5 times before they finally input a payment that succeeds, then they will have 6 customers in Stripe.
This is the code I'm using to subscribe new users:
$user->subscription($package->getStripeId())->create(Request::get('stripeToken'), [
'email' => $user->email
]);
Secondly is that if someone has a subscription and switches packages (with immediate prorate charge), if the prorate payment fails - Cashier still changes the package in Stripe. So my system won't necessarily upgrade their account, but next month they're going to be unsuspectingly charged for a more expensive package. I'm using the following code to swap packages.
$user->subscription($plan)->prorate()->swapAndInvoice();
I've spoken to Stripe and they said that a failed charge has no relevance on whether their system changes the package. So Cashier needs to handle the failed charge and keep the Stripe plan as it is.
Help is appreciated.
Please or to participate in this conversation.