/** * @return bool */ protected function needPayment() { if (isset($this->paymentMinLimits[$this->_payment->currency])) { return $this->_payment->getTotal() >= $this->paymentMinLimits[$this->_payment->currency]; } return true; }
/** * @param array $attributes * @return PaytrailPayment */ public static function create(array $attributes) { $model = new PaytrailPayment(); $model->attributes = $attributes; if (!$model->save()) { throw new CException('Failed to save paytrail payment.'); } return $model; }