This method is calling at checkout step but with plugin using after method it's not calling, core method is calling.
etc/di.xml
<type name="Magento\Checkout\Model\PaymentInformationManagement">
<plugin name="k365_payemnt_management_plugin" type="K365\Checkout\Plugin\Model\PaymentInfoManagement" />
</type>
PaymentInfoManagement.php
<?php
namespace K365\Checkout\Plugin\Model;
use Magento\Checkout\Model\PaymentInformationManagement;
class PaymentInfoManagement
{
public function afterSavePaymentInformationAndPlaceOrder(
PaymentInformationManagement $subject, $result,
$cartId,
\Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
\Magento\Quote\Api\Data\AddressInterface $billingAddress = null
) {
$this->getLogger()->critical(
'******calllllllllllllllllllllll ' );
$this->savePaymentInformation($cartId, $paymentMethod, $billingAddress);
try {
$orderId = $this->cartManagement->placeOrder($cartId);
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->getLogger()->critical(
'******Placing an order with quote_id ' . $cartId . ' is failed: ' . $e->getMessage()
);
throw new CouldNotSaveException(
__('*******'.$e->getMessage()),
$e
);
} catch (\Exception $e) {
$this->getLogger()->critical($e);
throw new CouldNotSaveException(
__('*******A server error stopped your order from being placed. Please try to place your order again.'),
$e
);
}
return $result;
}
}
Thanks....