App\Ninja\PaymentDrivers\BasePaymentDriver::customer PHP Method

customer() public method

if ($customer = $this->customer()) { $details['customerReference'] = $customer->token; } return $details; }
public customer ( $clientId = false )
    public function customer($clientId = false)
    {
        if ($this->customer) {
            return $this->customer;
        }
        if (!$clientId) {
            $clientId = $this->client()->id;
        }
        $this->customer = AccountGatewayToken::clientAndGateway($clientId, $this->accountGateway->id)->with('payment_methods')->first();
        if ($this->customer && $this->invitation) {
            $this->customer = $this->checkCustomerExists($this->customer) ? $this->customer : null;
        }
        return $this->customer;
    }