/** * {@inheritDoc} */ public function getPayment($name) { /** @var PaymentConfigInterface $config */ if ($config = $this->paymentConfigStore->findBy(array('paymentName' => $name))) { $factory = $this->getPaymentFactory($config->getFactoryName()); return $factory->create($config->getConfig()); } return $this->staticRegistry->getPayment($name); }