public function getConfigData($fieldToLookFor, $store = NULL) { $returnFromThisModel = ""; if ($fieldToLookFor == "title" || $fieldToLookFor == "active" || $fieldToLookFor == "accounttypes" || $fieldToLookFor == "payment_action" || $fieldToLookFor == "order_status") { $returnFromThisModel = Mage::getStoreConfig('payment/LEcheck/' . $fieldToLookFor); } else { $returnFromThisModel = Mage::getStoreConfig('payment/CreditCard/' . $fieldToLookFor); } if ($returnFromThisModel == NULL) { $returnFromThisModel = parent::getConfigData($fieldToLookFor, $store); } return $returnFromThisModel; }
/** * Check if can use method * * @param Mage_Payment_Model_Method_Abstract $method * @return bool */ protected function _canUseMethod($method) { if (!in_array($method->getCode(), $this->_getAllowedCaptureMethods())) { return false; } if (!$method->canUseForCountry($this->getOrder()->getBillingAddress()->getCountry())) { return false; } if (!$method->canUseForCurrency(Mage::app()->getStore()->getBaseCurrencyCode())) { return false; } /** * Checking for min/max order total for assigned payment method */ $total = $this->getOrder()->getBaseGrandTotal(); $minTotal = $method->getConfigData('min_order_total'); $maxTotal = $method->getConfigData('max_order_total'); if (!empty($minTotal) && $total < $minTotal || !empty($maxTotal) && $total > $maxTotal) { return false; } return true; }
public function getConfigData($field, $storeId = null) { $data = parent::getConfigData($field, $storeId); if ($data === null) { return $this->_getGeneralConfig($field, $storeId); } else { switch ($field) { case 'active': return $data && $this->_isActive($storeId); default: return $data; } } }
/** * @param string $field * @param int $storeId * @return mixed */ public function getConfigData($field, $storeId = null) { if ($field == 'sort_order') { try { $data = $this->getConfigForQuote()->getSortOrder(); } catch (Payone_Core_Exception_PaymentMethodConfigNotFound $e) { return 0; } } else { $data = parent::getConfigData($field, $storeId); } return $data; }
/** * @param string $field * @param null $storeId * @return mixed */ public function getConfigData($field, $storeId = null) { if ($this->isValidIndex()) { if ($field === "min_order_total") { return $this->_api->methods[$this->_index]['amount']->minimum; } if ($field === "max_order_total") { return $this->_api->methods[$this->_index]['amount']->maximum; } if ($field === "sort_order") { return $this->_api->methods[$this->_index]['sort_order']; } if ($field === "title") { return Mage::helper('core')->__($this->_api->methods[$this->_index]['description']); } } if ($field === "active") { return $this->_isAvailable(); } if ($field === "title") { return Mage::helper('core')->__('{Reserved}'); } return parent::getConfigData($field, $storeId); }
/** * Handle Approved answer * * @throws Exception */ protected function _processApproved() { $state = $this->_paymentMethod->getConfigData('after_pay_status'); $this->_order->setStatus($state)->addStatusHistoryComment('WayForPay returned an Approved status.'); $this->_order->save(); }