app/code/community/Adyen/Payment/controllers/PosController.php
public function placeOrderAction()
    {
        $quote = (Mage::getModel('checkout/type_onepage') !== false) ? Mage::getModel('checkout/type_onepage')->getQuote() : Mage::getModel('checkout/session')->getQuote();
        $service = Mage::getModel('sales/service_quote', $quote);

        $quote->getPayment()->setMethod('adyen_pos_cloud');
        $quote->collectTotals()->save();
        try {
            $service->submitAll();
            $order = $service->getOrder();
            $order->save();

            $result = self::ORDER_SUCCESS;

            // add order information to the session
            $session = Mage::getSingleton('checkout/session');
            $session->setLastOrderId($order->getId());
            $session->setLastRealOrderId($order->getIncrementId());
            $session->setLastSuccessQuoteId($order->getQuoteId());
            $session->setLastQuoteId($order->getQuoteId());
            $session->unsAdyenRealOrderId();
            $session->setQuoteId($session->getAdyenQuoteId(true));
            $session->getQuote()->setIsActive(false)->save();
        } catch (Exception $e) {
            Mage::logException($e);
            $result = self::ORDER_ERROR;
        }

        $this->getResponse()->setHeader('Content-type', 'application/json');
        $this->getResponse()->setBody($result);
        return $result;
    }
public function placeOrderAction()
    {
        $quote = (Mage::getModel('checkout/type_onepage') !== false) ? Mage::getModel('checkout/type_onepage')->getQuote() : Mage::getModel('checkout/session')->getQuote();
        $service = Mage::getModel('sales/service_quote', $quote);

        $quote->getPayment()->setMethod('adyen_pos_cloud');
        $quote->collectTotals()->save();
        try {
            $service->submitAll();
            $order = $service->getOrder();
            $order->save();

            $result = self::ORDER_SUCCESS;

            // add order information to the session
            $session = Mage::getSingleton('checkout/session');
            $session->setLastOrderId($order->getId());
            $session->setLastRealOrderId($order->getIncrementId());
            $session->setLastSuccessQuoteId($order->getQuoteId());
            $session->setLastQuoteId($order->getQuoteId());
            $session->unsAdyenRealOrderId();
            $session->setQuoteId($session->getAdyenQuoteId(true));
            $session->getQuote()->setIsActive(false)->save();
        } catch (Exception $e) {
            Mage::logException($e);
            $result = self::ORDER_ERROR;
        }

        $this->getResponse()->setHeader('Content-type', 'application/json');
        $this->getResponse()->setBody($result);
        return $result;
    }
public function placeOrderAction ( ) { $ quote = ( Mage :: getModel ( 'checkout/type_onepage' ) !== false ) ? Mage :: getModel ( 'checkout/type_onepage' ) -> getQuote ( ) : Mage :: getModel ( 'checkout/session' ) -> getQuote ( ) ; $ service = Mage :: getModel ( 'sales/service_quote' , $ quote ) ; $ quote -> getPayment ( ) -> setMethod ( 'adyen_pos_cloud' ) ; $ quote -> collectTotals ( ) -> save ( ) ; try { $ service -> submitAll ( ) ; $ order = $ service -> getOrder ( ) ; $ order -> save ( ) ; $ result = self :: ORDER_SUCCESS ; // add order information to the session $ session = Mage :: getSingleton ( 'checkout/session' ) ; $ session -> setLastOrderId ( $ order -> getId ( ) ) ; $ session -> setLastRealOrderId ( $ order -> getIncrementId ( ) ) ; $ session -> setLastSuccessQuoteId ( $ order -> getQuoteId ( ) ) ; $ session -> setLastQuoteId ( $ order -> getQuoteId ( ) ) ; $ session -> unsAdyenRealOrderId ( ) ; $ session -> setQuoteId ( $ session -> getAdyenQuoteId ( true ) ) ; $ session -> getQuote ( ) -> setIsActive ( false ) -> save ( ) ; } catch ( Exception $ e ) { Mage :: logException ( $ e ) ; $ result = self :: ORDER_ERROR ; } $ this -> getResponse ( ) -> setHeader ( 'Content-type' , 'application/json' ) ; $ this -> getResponse ( ) -> setBody ( $ result ) ; return $ result ; }
Places the order after a PAYMENT_SUCCESSFUL from
@see initiateAction or
@see checkStatusAction
@return string
Places the order after a PAYMENT_SUCCESSFUL from