From eebe510a3107e8e6c3e4b64d59d13d731a3c0e9a Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Tue, 12 May 2026 13:38:37 -0300 Subject: [PATCH] fix(billing): widen tracking exception catch so post-payment page never crashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `$account->stripe()` can throw `\Stripe\Exception\InvalidArgumentException` (descends from PHP's `InvalidArgumentException`, not `ApiErrorException`) when the Stripe key is missing/malformed. Since the conversion data is purely for tracking, any failure must degrade silently — not break the post-payment success page. --- app/Http/Controllers/App/BillingController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/App/BillingController.php b/app/Http/Controllers/App/BillingController.php index 71bd36b3..d955b6ea 100644 --- a/app/Http/Controllers/App/BillingController.php +++ b/app/Http/Controllers/App/BillingController.php @@ -11,8 +11,8 @@ use Illuminate\Support\Facades\Gate; use Inertia\Inertia; use Inertia\Response; -use Stripe\Exception\ApiErrorException as StripeApiErrorException; use Symfony\Component\HttpFoundation\Response as SymfonyResponse; +use Throwable; class BillingController extends Controller { @@ -101,7 +101,7 @@ private function buildConversionData(Account $account, string $sessionId): ?arra $sessionId, ['expand' => ['line_items.data.price']], ); - } catch (StripeApiErrorException) { + } catch (Throwable) { return null; }