Beispiel #1
0
 /**
  * Check whether void is available for the given order.
  */
 public function canVoid(Varien_Object $payment)
 {
     if (parent::canVoid($payment)) {
         if ($payment->getOrder() instanceof Mage_Sales_Model_Order && $payment->getOrder()->canCancel()) {
             /**
              * Bad convention: Auth code is stored as the second part of ext_order_id.
              * If there is no auth code, it has already been voided or is not relevant.
              */
             $transactionId = explode(':', $payment->getOrder()->getExtOrderId(), 2);
             if (!isset($transactionId[1]) || empty($transactionId[1])) {
                 return false;
             }
         }
         return true;
     }
     return false;
 }