fix(billing): widen tracking exception catch so post-payment page never crashes

`$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.
This commit is contained in:
Paulo Castellano 2026-05-12 13:38:37 -03:00
parent 4efc6f467d
commit eebe510a31

View file

@ -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;
}