tokenManagement = $tokenManagement; $this->session = $session; } /** * Returns list of payment tokens for current customer session * * @return PaymentTokenInterface[] */ public function getCustomerSessionTokens() { $customerId = $this->session->getCustomerId(); if (!$customerId || $this->session->isLoggedIn() === false) { return []; } return $this->tokenManagement->getVisibleAvailableTokens($customerId); } }