diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php index 11d9cda41e9f..4425adeebaa3 100644 --- a/app/Services/PaymentService.php +++ b/app/Services/PaymentService.php @@ -821,6 +821,11 @@ class PaymentService extends BaseService $invitation = $invoice->invitations->first(); $token = $client->getGatewayToken($accountGateway/* return parameter */, $accountGatewayToken/* return parameter */); + + if (!$accountGatewayToken) { + return false; + } + $defaultPaymentMethod = $accountGatewayToken->default_payment_method; if (!$invitation || !$token || !$defaultPaymentMethod) {