private function createDadosPortador(Transaction $transaction, DOMDocument $document)
{
$holder = $transaction->getHolder();
$holderName = $holder->getName();
$expiration = $holder->getExpiration();
$token = $holder->getToken();
$dadosPortador = $document->createElementNS(self::NS, 'dados-portador');
$this->createElementAndAppendWithNs($dadosPortador, 'numero', $holder->getCreditCardNumber());
if (!empty($expiration)) {
$this->createElementAndAppendWithNs($dadosPortador, 'validade', $expiration);
}
$this->createElementAndAppendWithNs($dadosPortador, 'indicador', $holder->getCVVIndicator());
$this->createElementAndAppendWithNs($dadosPortador, 'codigo-seguranca', $holder->getCVV());
if (!empty($holderName)) {
$this->createElementAndAppendWithNs($dadosPortador, 'nome-portador', $holderName);
}
$this->createElementAndAppendWithNs($dadosPortador, 'token', empty($token) ? null : $token);
return $dadosPortador;
}