/** * Get input errors * * @param array $data Input data * * @return array */ public function getInputErrors(array $data) { $errors = parent::getInputErrors($data); foreach ($this->getInputDataLabels() as $k => $t) { if (!isset($data[$k]) || !$data[$k]) { $errors[] = \XLite\Core\Translation::lbl('X field is required', array('field' => $t)); } } return $errors; }
/** * Check if payment method allowed for the order * * @param \XLite\Model\Order $order Order * @param \XLite\Model\Payment\Method $method Payment method * * @return boolean */ public function isApplicable(\XLite\Model\Order $order, \XLite\Model\Payment\Method $method) { return parent::isApplicable($order, $method) && $this->getCarrierCode() && $this->isCODAllowed($order); }