setType(PaymentMethodType::ELECTRONIC_CERTIFICATE); } /** * Возвращает card. * * @return BankCard|null Данные банковской карты «Мир» */ public function getCard() { return $this->_card; } /** * Устанавливает card. * * @param BankCard|array|null $value Данные банковской карты «Мир» * * @return self */ public function setCard($value = null) { if ($value === null || $value === '') { $this->_card = null; } elseif (is_array($value)) { $this->_card = new BankCard($value); } elseif ($value instanceof BankCard) { $this->_card = $value; } else { throw new InvalidPropertyValueTypeException( 'Invalid card value type in PaymentMethodElectronicCertificate', 0, 'PaymentMethodElectronicCertificate.card', $value ); } return $this; } /** * Возвращает electronic_certificate. * * @return ElectronicCertificatePaymentData|null Данные от ФЭС НСПК для оплаты по электронному сертификату */ public function getElectronicCertificate() { return $this->_electronic_certificate; } /** * Устанавливает electronic_certificate. * * @param ElectronicCertificatePaymentData|array|null $value Данные от ФЭС НСПК для оплаты по электронному сертификату. * * @return self */ public function setElectronicCertificate($value = null) { if ($value === null || $value === '') { $this->_electronic_certificate = null; } elseif (is_array($value)) { $this->_electronic_certificate = new ElectronicCertificatePaymentData($value); } elseif ($value instanceof ElectronicCertificatePaymentData) { $this->_electronic_certificate = $value; } else { throw new InvalidPropertyValueTypeException( 'Invalid electronicCertificate value type in PaymentMethodElectronicCertificate', 0, 'PaymentMethodElectronicCertificate.electronicCertificate', $value ); } return $this; } /** * Возвращает articles. * * @return array|null Одобренная корзина покупки — список товаров */ public function getArticles() { return $this->_articles; } /** * Устанавливает articles. * * @param array|null $value Одобренная корзина покупки — список товаров * * @return self */ public function setArticles($value = null) { if ($value === null || $value === '' || (is_array($value) && empty($value))) { $this->_articles = null; } elseif (is_array($value)) { $articles = array(); foreach ($value as $item) { if (is_array($item)) { $articles[] = new ElectronicCertificateApprovedPaymentArticle($item); } elseif ($item instanceof ElectronicCertificateApprovedPaymentArticle) { $articles[] = $item; } else { throw new InvalidPropertyValueTypeException( 'Article must be instance of ElectronicCertificateApprovedPaymentArticle', 0, 'PaymentMethodElectronicCertificate.articles', $item ); } } $this->_articles = $articles; } else { throw new InvalidPropertyValueTypeException( 'Invalid articles value type in PaymentMethodElectronicCertificate', 0, 'PaymentMethodElectronicCertificate.articles', $value ); } return $this; } }