/** * @param Mage_Sales_Model_Quote|null $quote * @return bool */ public function isAvailable($quote = null) { $isAvailable = parent::isAvailable(); $disableZeroTotal = Mage::getStoreConfig('payment/adyen_hpp/disable_zero_total', $quote->getStoreId()); if (!is_null($quote) && $quote->getGrandTotal() <= 0 && $disableZeroTotal) { return false; } return $isAvailable; }
public function validate() { parent::validate(); $info = $this->getInfoInstance(); $hppType = $info->getCcType(); // validate if the ideal bank is chosen if ($hppType == "ideal") { if ($info->getPoNumber() == "") { // hpp type is empty throw error Mage::throwException(Mage::helper('adyen')->__('You chose an invalid bank')); } } }
/** * @desc Openinvoice Optional Fields. * @desc Notice these are used to prepopulate the fields, but client can edit them at Adyen. * @return type array */ public function getFormFields() { $adyFields = parent::getFormFields(); $adyFields = $this->getOptionalFormFields($adyFields, $this->_order); return $adyFields; }