scopeConfig = $scopeConfig; $this->methodCode = $methodCode; $this->pathPattern = $pathPattern; } /** * Sets method code * * @param string $methodCode * @return void */ public function setMethodCode($methodCode) { $this->methodCode = $methodCode; } /** * Sets path pattern * * @param string $pathPattern * @return void */ public function setPathPattern($pathPattern) { $this->pathPattern = $pathPattern; } /** * Retrieve information from payment configuration * * @param string $field * @param int|null $storeId * * @return mixed */ public function getValue($field, $storeId = null) { if ($this->methodCode === null || $this->pathPattern === null) { return null; } return $this->scopeConfig->getValue( sprintf($this->pathPattern, $this->methodCode, $field), ScopeInterface::SCOPE_STORE, $storeId ); } }