/**
  * save order
  *
  * @param Eway_Rapid31_Model_Response $response
  * @param string $successType
  * @return string
  */
 private function storeOrder($response, $successType = 'success')
 {
     try {
         // Clear the basket and save the order (including some info about how the payment went)
         $this->getOnepage()->getQuote()->collectTotals();
         $payment = $this->getOnepage()->getQuote()->getPayment();
         $payment->setAdditionalInformation('successType', $successType);
         Mage::getSingleton('core/session')->setData('ewayTransactionID', $response->getTransactionID());
         $orderId = $this->getOnepage()->saveOrder()->getLastOrderId();
         $this->getOnepage()->getQuote()->save();
         return $orderId;
     } catch (Exception $e) {
         Mage::throwException(Mage::helper('ewayrapid')->__($e->getMessage()));
     }
 }
Exemplo n.º 2
0
 /**
  * Call Capture API (do the Capture only, must Authorized previously)
  *
  * @param Eway_Rapid31_Model_Response $response
  * @return Eway_Rapid31_Model_Response
  */
 public function doCapturePayment(Eway_Rapid31_Model_Response $response)
 {
     $this->setTransactionId($response->getTransactionID());
     $this->setMethod(Eway_Rapid31_Model_Config::METHOD_PROCESS_PAYMENT);
     $response = $this->_doRapidAPI('CapturePayment');
     return $response;
 }