diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index fcfd766837d9..43290710a70d 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -56,7 +56,11 @@ class BaseDriver extends AbstractPaymentDriver /* The Invitation */ public $invitation; - /* The client */ + /** + * The Client + * + * @var \App\Models\Client|null $client + */ public $client; /* Gateway capabilities */ diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index 951d9eea9bed..a80c09789dcd 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -891,9 +891,11 @@ class StripePaymentDriver extends BaseDriver return Account::all(); } - public function setClientFromCustomer($customer) + public function setClientFromCustomer($customer): self { - $this->client = ClientGatewayToken::query()->where('gateway_customer_reference', $customer)->client; + $this->client = ClientGatewayToken::query()->where('gateway_customer_reference', $customer)->first()->client; + + return $this; } /**