41 private $paymentDataHelper;
58 Data $paymentDataHelper,
61 parent::__construct($context, $paymentConfig,
$data);
65 $this->paymentDataHelper = $paymentDataHelper;
74 $configuredCardTypes = $this->getConfiguredCardTypes();
75 $countryId = $this->sessionQuote->getQuote()->getBillingAddress()->getCountryId();
76 return $this->filterCardTypesForCountry($configuredCardTypes, $countryId);
85 return $this->gatewayConfig->isCvvEnabled($this->sessionQuote->getStoreId());
94 $vaultPayment = $this->getVaultPayment();
95 return $vaultPayment->isActive($this->sessionQuote->getStoreId());
102 private function getConfiguredCardTypes()
104 $types = $this->ccType->getCcTypeLabelMap();
105 $configCardTypes = array_fill_keys(
106 $this->gatewayConfig->getAvailableCardTypes($this->sessionQuote->getStoreId()),
110 return array_intersect_key($types, $configCardTypes);
119 private function filterCardTypesForCountry(array $configCardTypes, $countryId)
121 $filtered = $configCardTypes;
122 $countryCardTypes = $this->gatewayConfig->getCountryAvailableCardTypes(
124 $this->sessionQuote->getStoreId()
128 if (!empty($countryCardTypes)) {
129 $availableTypes = array_fill_keys($countryCardTypes,
'');
130 $filtered = array_intersect_key($filtered, $availableTypes);
139 private function getVaultPayment()