config = $config; parent::__construct($resultFactory); } /** * @param array $validationSubject * @return bool * @throws NotFoundException * @throws \Exception */ public function validate(array $validationSubject) { $isValid = true; $storeId = $validationSubject['storeId']; if ((int)$this->config->getValue('allowspecific', $storeId) === 1) { $availableCountries = explode( ',', $this->config->getValue('specificcountry', $storeId) ); if (!in_array($validationSubject['country'], $availableCountries)) { $isValid = false; } } return $this->createResult($isValid); } }