scopeConfig->getValue( self::PATH_PREFIX . $field, ScopeInterface::SCOPE_STORE, $storeId )); } public function getSecret(string $field, ?int $storeId = null): string { $prefix = $this->isSandbox($storeId) ? 'sandbox_' : 'production_'; return $this->secretValueDecoder->decode($this->getValue($prefix . $field, $storeId)); } public function isSandbox(?int $storeId = null): bool { return $this->scopeConfig->isSetFlag( self::PATH_PREFIX . 'sandbox', ScopeInterface::SCOPE_STORE, $storeId ); } public function isDebug(?int $storeId = null): bool { return $this->scopeConfig->isSetFlag( self::PATH_PREFIX . 'debug', ScopeInterface::SCOPE_STORE, $storeId ); } public function getEndpoint(?int $storeId = null): string { return $this->isSandbox($storeId) ? self::SANDBOX_ENDPOINT : self::PRODUCTION_ENDPOINT; } public function isConfigured(?int $storeId = null): bool { return $this->getSecret('account', $storeId) !== '' && $this->getSecret('terminal', $storeId) !== '' && $this->getSecret('secure_code', $storeId) !== ''; } }