protected function _afterLoad()
 {
     parent::_afterLoad();
     if (is_string($this->getTransactionObject())) {
         $this->setTransactionObject(Mage::helper('SaferpayCw')->unserialize($this->getTransactionObject()));
         $orderId = $this->getOrderId();
         if (!empty($orderId)) {
             Customweb_SaferpayCw_Model_ConfigurationAdapter::setStore($this->getOrder());
         }
     }
 }
Example #2
0
 /**
  *         	   		  	 	 	
  * @return NULL
  */
 public function getAuthorizationAdapter($isOrderAvailable, Customweb_SaferpayCw_Model_Transaction $transaction = null)
 {
     if ($this->authorizationAdapter == null) {
         if ($this->authorizationMethodName != null) {
             $this->authorizationAdapter = $this->getHelper()->getAuthorizationAdapter($this->authorizationMethodName);
         } else {
             if ($isOrderAvailable == true) {
                 $order = Mage::getModel('sales/order');
                 $order->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
                 Customweb_SaferpayCw_Model_ConfigurationAdapter::setStore($order);
             }
             if ($transaction && $transaction !== null && $transaction->getTransactionObject() !== null && $transaction->getTransactionObject()->getTransactionContext()->isMotoTransaction()) {
                 $this->authorizationAdapter = $this->getHelper()->getAuthorizationAdapter(Customweb_Payment_Authorization_Moto_IAdapter::AUTHORIZATION_METHOD_NAME);
             } else {
                 $this->authorizationAdapter = $this->getHelper()->getAuthorizationAdapterByContext($this->getOrderContext($isOrderAvailable));
             }
             $this->authorizationMethodName = $this->authorizationAdapter->getAuthorizationMethodName();
         }
     }
     return $this->authorizationAdapter;
 }