public function isAvailable($quote = null) { $isAvailable = parent::isAvailable($quote); // check if ip range is enabled $ipFilter = $this->_getConfigData('ip_filter', 'adyen_cash'); if ($isAvailable && $ipFilter) { // check if ip is in range $ip = Mage::helper('adyen')->getClientIp(); $from = $this->_getConfigData('ip_filter_from', 'adyen_cash'); $to = $this->_getConfigData('ip_filter_to', 'adyen_cash'); $isAvailable = Mage::helper('adyen')->ipInRange($ip, $from, $to); } return $isAvailable; }
public function __construct() { // check if this is adyen_cc payment method because this function is as well used for oneclick payments if ($this->getCode() == "adyen_pay_by_mail") { $visible = Mage::getStoreConfig("payment/adyen_pay_by_mail/visible_type"); if ($visible == "backend") { $this->_canUseCheckout = false; $this->_canUseInternal = true; } else { if ($visible == "frontend") { $this->_canUseCheckout = true; $this->_canUseInternal = false; } else { $this->_canUseCheckout = true; $this->_canUseInternal = true; } } } parent::__construct(); }
/** * @desc Called just after asssign data */ public function prepareSave() { parent::prepareSave(); }
/** * Called just after asssign data * * @return Mage_Payment_Model_Abstract */ public function prepareSave() { //@todo encryption or so parent::prepareSave(); }
/** * @param Mage_Sales_Model_Quote|null $quote * @return bool */ public function isAvailable($quote = null) { $isAvailable = parent::isAvailable(); if (!is_null($quote)) { $disableZeroTotal = Mage::getStoreConfig('payment/adyen_hpp/disable_zero_total', $quote->getStoreId()); } else { $disableZeroTotal = Mage::getStoreConfig('payment/adyen_hpp/disable_zero_total'); } if (!is_null($quote) && $quote->getGrandTotal() <= 0 && $disableZeroTotal) { return false; } return $isAvailable; }
/** * @desc Specific functions for 3d secure validation */ public function getOrderPlaceRedirectUrl() { $redirectUrl = Mage::getSingleton('customer/session')->getRedirectUrl(); if (!empty($redirectUrl)) { Mage::getSingleton('customer/session')->unsRedirectUrl(); return Mage::getUrl($redirectUrl); } else { return parent::getOrderPlaceRedirectUrl(); } }