示例#1
0
 /**
  * Instantiate IPN model and pass IPN request to it
  *
  * @return void
  */
 public function execute()
 {
     if (!$this->getRequest()->isPost()) {
         return;
     }
     try {
         $data = $this->getRequest()->getPost();
         $this->_ipnFactory->create(array('data' => $data))->processIpnRequest();
     } catch (\Exception $e) {
         $this->_logger->logException($e);
     }
 }
示例#2
0
 /**
  * Instantiate IPN model and pass IPN request to it
  *
  * @return void
  * @SuppressWarnings(PHPMD.ExitExpression)
  */
 public function execute()
 {
     if (!$this->getRequest()->isPost()) {
         return;
     }
     try {
         $data = $this->getRequest()->getPostValue();
         $this->_ipnFactory->create(['data' => $data])->processIpnRequest();
     } catch (RemoteServiceUnavailableException $e) {
         $this->_logger->critical($e);
         $this->getResponse()->setStatusHeader(503, '1.1', 'Service Unavailable')->sendResponse();
         /** @todo eliminate usage of exit statement */
         exit;
     } catch (\Exception $e) {
         $this->_logger->critical($e);
         $this->getResponse()->setHttpResponseCode(500);
     }
 }
示例#3
0
文件: Index.php 项目: aiesh/magento2
 /**
  * Instantiate IPN model and pass IPN request to it
  *
  * @return void
  */
 public function execute()
 {
     if (!$this->getRequest()->isPost()) {
         return;
     }
     try {
         $data = $this->getRequest()->getPost();
         $this->_ipnFactory->create(array('data' => $data))->processIpnRequest();
     } catch (UnavailableException $e) {
         $this->_logger->logException($e);
         $this->getResponse()->setHeader('HTTP/1.1', '503 Service Unavailable')->sendResponse();
         /** @todo eliminate usage of exit statement */
         exit;
     } catch (\Exception $e) {
         $this->_logger->logException($e);
         $this->getResponse()->setHttpResponseCode(500);
     }
 }