/** * Redirect to romview after validating that correct information has actually been answered */ public function viewAction() { Mage::unregister('rom_order'); /** @var Zend_Controller_Request_Http */ $request = $this->getRequest(); $orderId = $request->getPost('oar_order_id'); $orderEmail = $request->getPost('oar_email'); $orderZip = $request->getPost('oar_zip'); $orderLastname = $request->getPost('oar_billing_lastname'); /** @var Mage_Core_Model_Session */ $session = $this->_orderFactory->getCoreSessionModel(); // Clearing out messages $session->getMessages(true); /** @var EbayEnterprise_Order_Model_Detail */ $detailApi = $this->_orderFactory->getNewRomOrderDetailModel($orderId); try { /** @var EbayEnterprise_Order_Model_Detail_Order $romOrderObject */ $romOrderObject = $detailApi->process(); } catch (EbayEnterprise_Order_Exception_Order_Detail_Notfound_Exception $e) { $session->addError($e->getMessage()); $this->_redirect('sales/guest/form'); return; } if ($this->_hasValidOrderResult($romOrderObject, $orderEmail, $orderZip, $orderLastname)) { $this->_redirect('sales/order/romguestview', ['order_id' => $orderId]); } else { $session->addError($this->_orderHelper->__('Order not found.')); $this->_redirect('sales/guest/form'); } return; }
/** * Test that the controller method ebayenterprise_order/factory::getCoreSessionModel() * is invoked and it will instantiate an object of type core/session and return this object. */ public function testGetCoreSessionModel() { /** @var Mock_Mage_Core_Model_Session */ $session = $this->getModelMockBuilder('core/session')->disableOriginalConstructor()->getMock(); $this->replaceByMock('singleton', 'core/session', $session); $this->assertSame($session, $this->_factory->getCoreSessionModel()); }
/** * @see Mage_Checkout_Block_Multishipping_Success::getViewOrderUrl() * Overriding this method in order to redirect registered user to the correct * ROM order detail view page in Multi-shipping checkout success page. * * @param int * @return string */ public function getViewOrderUrl($orderId) { $orderIds = $this->getOrderIds(); $incrementId = isset($orderIds[$orderId]) ? $orderIds[$orderId] : null; Mage::register('rom_order_id', $incrementId); // clearing out the multi-shipping ids from core session, see the // Mage_Checkout_Block_Multishipping_Success::getOrderIds() method. $this->orderFactory->getCoreSessionModel()->getOrderIds(true); return $this->getUrl('sales/order/romview', ['order_id' => $incrementId]); }