Beispiel #1
0
 /**
  * Cancel a Magento order based on Sage Pay transaction object
  *
  * @param  Ebizmarts_SagePaySuite_Model_Sagepaysuite_Transaction $transaction
  * @return null|Mage_Sales_Model_Order
  */
 public function cancelTransaction(Ebizmarts_SagePaySuite_Model_Sagepaysuite_Transaction $transaction)
 {
     $orderId = $transaction->getOrderId();
     if (!$orderId) {
         return;
     }
     $order = Mage::getModel('sales/order')->load($orderId);
     return $order->cancel();
 }
Beispiel #2
0
 public function push(Ebizmarts_SagePaySuite_Model_Sagepaysuite_Transaction $trn)
 {
     $this->setTransactionId($trn->getId())->setInitialStatus($trn->getStatus())->setInitialStatusDetail($trn->getStatusDetail())->setProcessed(0)->setProcessedStatus("idle")->setProcessedStatusDetail("Queued")->setCreatedAt(Mage::getModel('core/date')->gmtDate())->save();
     return $this;
 }