Commit 94a03d47 authored by GiorgosK's avatar GiorgosK

Injecting Logger into redirect form

parent 711b166c
......@@ -7,10 +7,32 @@ use Drupal\commerce_payment\Exception\PaymentGatewayException;
use Drupal\commerce_payment\PluginForm\PaymentOffsiteForm as BasePaymentOffsiteForm;
use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
/**
*
*/
class WinbankPaymentRedirectForm extends BasePaymentOffsiteForm {
class WinbankPaymentRedirectForm extends BasePaymentOffsiteForm implements ContainerInjectionInterface {
/**
* The logger.
*
* @var \Drupal\Core\Logger\LoggerChannelInterface
*/
protected $logger;
function __construct(LoggerChannelFactoryInterface $logger_factory) {
//$this->loggerFactory = $logger_factory;
$this->logger = $logger_factory->get('commerce_winbank_redirect');
}
public static function create(ContainerInterface $container) {
return new static(
$container->get('logger.factory')
);
}
/**
* {@inheritdoc}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment