store = $storeManager->getStore(); $this->config = $config; } /** * Validate * * @param bool $isValid * @param array $fails * @return ResultInterface * @SuppressWarnings(PMD.UnusedFormalParameter) */ public function validate(array $validationSubject) { $merchant_id = $this->config->getValue('klarna/api/merchant_id', ScopeInterface::SCOPE_STORES, $this->store); $secret = $this->config->getValue('klarna/api/shared_secret', ScopeInterface::SCOPE_STORES, $this->store); if (empty($merchant_id) || empty($secret)) { return $this->createResult(false, [__('Klarna API Credentials are required')]); } return $this->createResult(true); } }