15 use Magento\Sales\Model\OrderFactory;
35 private $orderFactory;
45 \
Magento\Paypal\Model\IpnFactory $ipnFactory,
47 OrderFactory $orderFactory =
null 50 $this->_ipnFactory = $ipnFactory;
52 parent::__construct($context);
86 $this->_ipnFactory->create([
'data' =>
$data])->processIpnRequest();
87 $incrementId = $this->
getRequest()->getPostValue()[
'invoice'];
88 $this->_eventManager->dispatch(
89 'paypal_checkout_success',
91 'order' => $this->orderFactory->create()->loadByIncrementId($incrementId)
95 $this->_logger->critical($e);
96 $this->
getResponse()->setStatusHeader(503,
'1.1',
'Service Unavailable')->sendResponse();
100 $this->_logger->critical($e);
createCsrfValidationException(RequestInterface $request)
validateForCsrf(RequestInterface $request)
__construct(\Magento\Framework\App\Action\Context $context, \Magento\Paypal\Model\IpnFactory $ipnFactory, \Psr\Log\LoggerInterface $logger, OrderFactory $orderFactory=null)