storeManager = $storeManager; $this->session = $session; } /** * Retrieve assoc array of checkout configuration * * @return array * @since 100.1.0 */ public function getConfig() { $availableMethods = []; $storeId = $this->storeManager->getStore()->getId(); $vaultPayments = $this->getVaultPaymentList()->getActiveList($storeId); $customerId = $this->session->getCustomerId(); foreach ($vaultPayments as $method) { $availableMethods[$method->getCode()] = [ 'is_enabled' => $customerId !== null && $method->isActive($storeId) ]; } return [ self::$vaultCode => $availableMethods ]; } /** * Get vault payment list instance * @return PaymentMethodListInterface * @deprecated 100.2.0 */ private function getVaultPaymentList() { if ($this->vaultPaymentList === null) { $this->vaultPaymentList = ObjectManager::getInstance()->get(PaymentMethodListInterface::class); } return $this->vaultPaymentList; } }