setType(PaymentMethodType::BANK_CARD); } /** * Возвращает последние 4 цифры номера карты * @deprecated Будет удален в следующих версиях * @return string Последние 4 цифры номера карты */ public function getLast4() { return $this->getCard() ? $this->getCard()->getLast4() : null; } /** * Возвращает первые 6 цифр номера карты * @deprecated Будет удален в следующих версиях * @return string Первые 6 цифр номера карты * @since 1.0.14 */ public function getFirst6() { return $this->getCard() ? $this->getCard()->getFirst6() : null; } /** * Возвращает срок действия, год * @deprecated Будет удален в следующих версиях * @return string Срок действия, год */ public function getExpiryYear() { return $this->getCard() ? $this->getCard()->getExpiryYear() : null; } /** * Возвращает срок действия, месяц * @deprecated Будет удален в следующих версиях * @return string Срок действия, месяц */ public function getExpiryMonth() { return $this->getCard() ? $this->getCard()->getExpiryMonth() : null; } /** * Возвращает тип банковской карты * @deprecated Будет удален в следующих версиях * @return string Тип банковской карты */ public function getCardType() { return $this->getCard() ? $this->getCard()->getCardType() : null; } /** * Возвращает код страны, в которой выпущена карта. Передается в формате ISO-3166 alpha-2 * @deprecated Будет удален в следующих версиях * @return string Код страны, в которой выпущена карта */ public function getIssuerCountry() { return $this->getCard() ? $this->getCard()->getIssuerCountry() : null; } /** * Возвращает наименование банка, выпустившего карту * @deprecated Будет удален в следующих версиях * @return string Наименование банка, выпустившего карту. */ public function getIssuerName() { return $this->getCard() ? $this->getCard()->getIssuerName() : null; } /** * Возвращает источник данных банковской карты * @deprecated Будет удален в следующих версиях * @return string Источник данных банковской карты */ public function getSource() { return $this->getCard() ? $this->getCard()->getSource() : null; } /** * Возвращает данные банковской карты * @return BankCard Данные банковской карты */ public function getCard() { return $this->_card; } /** * Устанавливает данные банковской карты * @param BankCard|array $value Данные банковской карты */ public function setCard($value) { if ($value === null || $value === '') { throw new EmptyPropertyValueException('Empty card value', 0, 'PaymentMethodBankCard.card'); } if (is_array($value)) { $this->_card = new BankCard($value); } elseif ($value instanceof BankCard) { $this->_card = $value; } else { throw new InvalidPropertyValueTypeException( 'Invalid card value type', 0, 'PaymentMethodBankCard.card', $value ); } } #[\ReturnTypeWillChange] /** * @inheritdoc */ public function jsonSerialize() { $return = parent::jsonSerialize(); foreach (array('first6','last4','expiry_year','expiry_month','card_type','issuer_country','issuer_name','source') as $key) { unset($return[$key]); } return $return; } }