I have discovered that this is a flaw in the payroll class. The fix is very simple.
Open the file PagSeguroPaymentParser.class.php and go to line 72, where the following code snippet exists:
if ($payment->getSender()->getDocuments() != null) {
$documents = $payment->getSender()->getDocuments();
if (is_array($documents) && count($documents) == 1) {
foreach ($documents as $document) {
if (!is_null($document)) {
$data['senderCPF'] = $document->getValue(); //essa linha ta errada.. estão ignorando o tipo do documento q vc informa
}
}
}
}
Just change by:
if ($payment->getSender()->getDocuments() != null) {
$documents = $payment->getSender()->getDocuments();
if (is_array($documents) && count($documents) == 1) {
foreach ($documents as $document) {
if (!is_null($document)) {
$data['sender'.$document->getType()] = $document->getValue();
}
}
}
}