Example #1
0
 /**
  * Set order status to Pending until IPN
  * @return bool
  */
 public function isInitializeNeeded()
 {
     if ($this->is3dSecureEnabled()) {
         return true;
     }
     return parent::isInitializeNeeded();
 }
 /**
  * Check whether payment method can be used
  *
  * @param Mage_Sales_Model_Quote $quote
  * @return boolean
  */
 public function isAvailable($quote = null)
 {
     if (!parent::isAvailable($quote)) {
         return false;
     }
     if ($this->is3dSecureEnabled() && Mage::app()->getStore()->isAdmin()) {
         return false;
     }
     return true;
 }
 /**
  * Check whether it's possible to void authorization
  *
  * @param Varien_Object $payment
  * @return bool
  */
 public function canVoid(Varien_Object $payment)
 {
     $canVoid = parent::canVoid($payment);
     if ($canVoid) {
         $order = $this->getInfoInstance()->getOrder();
         if ($order && count($order->getInvoiceCollection()) > 0) {
             $canVoid = false;
         }
     }
     return $canVoid;
 }