/** * @param Customweb_SaferpayCw_Model_Transaction $transaction * @param Mage_Sales_Model_Order $order * @param boolean $moto * @return Customweb_SaferpayCw_Model_Transaction */ public function updateTransaction(Customweb_SaferpayCw_Model_Transaction $transaction, Mage_Sales_Model_Order $order, $moto = false) { if (!$transaction->getOrderId()) { $transaction->setOrderId($order->getId()); $transaction->setOrderPaymentId($order->getPayment()->getId()); $transaction->setAliasActive($this->getPaymentMethodConfigurationValue('alias_manager') == 'active'); $transaction->save(); if ($moto) { $transactionContext = $this->getMotoTransactionContext($order, $transaction); $adapter = $this->getHelper()->getAuthorizationAdapter(Customweb_Payment_Authorization_Moto_IAdapter::AUTHORIZATION_METHOD_NAME); } else { $transactionContext = $this->getTransactionContext($order, $transaction); $adapter = $this->getAuthorizationAdapter(true); } // TODO implement failed transaction recovery (second param) $transactionObject = $adapter->createTransaction($transactionContext, null); $transaction->setTransactionObject($transactionObject); $transaction->save(); } return $transaction; }