6 declare(strict_types=1);
11 use Magento\Framework\Validation\ValidationResultFactory;
23 private $generalMessage;
28 private $allowedCountryReader;
33 private $validationResultFactory;
42 ValidationResultFactory $validationResultFactory,
43 string $generalMessage =
'' 45 $this->allowedCountryReader = $allowedCountryReader;
46 $this->validationResultFactory = $validationResultFactory;
47 $this->generalMessage = $generalMessage;
55 $validationErrors = [];
57 if (!
$quote->isVirtual()) {
63 $this->allowedCountryReader->getAllowedCountries(
68 if (!$validationResult) {
69 $validationErrors = [
__($this->generalMessage)];
73 return [$this->validationResultFactory->create([
'errors' => $validationErrors])];
__construct(AllowedCountries $allowedCountryReader, ValidationResultFactory $validationResultFactory, string $generalMessage='')