I'm trying to create plugin for Magento/Checkout/Model/PaymentInformationManagement class
When I'm placing the order, the program stops after constructor in my plugin class.
Here is /etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Checkout\Model\PaymentInformationManagement">
<plugin name="save-quote" type="Company\Newsletter\Model\Plugin\Checkout\MyPaymentInformationManagement" sortOrder="110"/>
</type>
</config>
And /Model/Plugin/Checkout/MyPaymentInformationManagement.php
<?php
namespace Company\Newsletter\Model\Plugin\Checkout;
use Magento\Quote\Model\QuoteRepository;
use Magento\Checkout\Model\PaymentInformationManagement as
PaymentManagement;
use Magento\Checkout\Api\Data\PaymentDetailsInterface;
class MyPaymentInformationManagement
{
/**
* @var \Magento\Quote\Model\QuoteRepository
*/
protected $_quoteRepository;
/**
* @param QuoteRepository $quoteRepository
*/
public function __construct(QuoteRepository $quoteRepository)
{
$this->_quoteRepository = $quoteRepository;
}
public function beforeSavePaymentInformation(PaymentManagement $subject, $cartId, PaymentDetailsInterface $paymentInformation)
{
//some code
}
}