Closed Juleshendriks closed 5 months ago
Hi @Juleshendriks,
to handle a failed payment you listen for OrderPaymentFailed
and OrderPaymentFailedDueToInvalidMandate
events. As you correctly stated, you can use those events to notify the customer to update their payment method..
$updatePaymentMethodUrl = $user
->updatePaymentMethod()
->skipBalance()
->create()
->getTargetUrl();
After the customer has changed its payment method, he will be redirected to the cashier. update_payment_method. redirect_url
. You can define a controller for this route which then will retry the payment.
// get failed order
$order = $request()->user()->orders->latest()->first();
$order->retryNow();
Hope that helps! Let me know if you need additional information
@Naoray Thanks for your response! Makes things clear.
Hello Everyone,
I am working on a project and I'm stuck at the payment flow..
When a payment fails, what is a logical approach to take? I use the Laravel Cashier Mollie package.
When a payment fails, the subscription gets canceled, this is default behaviour.
I can notify my customer via email.
And then what?
The customer Starts a new subscription? Which wil leave old payments 'open'.
The customer updates his payment method and retries the payment?
I dont know.
Are there tips on how to test recurring failed payments?
Thank you in advance!