Skip to content

Commit 58183cd

Browse files
committed
fix: redirect au lieu de 403 pour les factures non-pending sur la route return
Evite un 403 inutile quand le webhook a déjà complété la facture avant le redirect client (Stripe, PayPal, Mollie).
1 parent aa5b679 commit 58183cd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/Http/Controllers/Front/Billing/PaymentGatewayController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ public function return(Request $request, Invoice $invoice, string $gateway)
5454
{
5555
try {
5656
abort_unless($invoice->customer_id === auth('web')->id(), 403);
57-
abort_unless($invoice->status === Invoice::STATUS_PENDING, 403);
57+
if ($invoice->status !== Invoice::STATUS_PENDING) {
58+
return redirect()->route('front.invoices.show', $invoice);
59+
}
5860

5961
$gateway = Gateway::where('uuid', $gateway)->first();
6062
abort_if(! $gateway, 404);

0 commit comments

Comments
 (0)