Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
Update parse dni response
Browse files Browse the repository at this point in the history
  • Loading branch information
giansalex committed Sep 30, 2021
1 parent f90dd77 commit 8975734
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Peru/Jne/DniParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@

class DniParser
{
public function parse(string $dni, string $raw): ?Person
public function parse(string $dni, $data): ?Person
{
$parts = explode('|', $raw);
if (count($parts) !== 3 || empty($parts[0])) {
return null;
}

$person = new Person();
$person->dni = $dni;
$person->apellidoPaterno = $parts[0];
$person->apellidoMaterno = $parts[1];
$person->nombres = $parts[2];
$person->apellidoPaterno = $data->apePatSoli;
$person->apellidoMaterno = $data->apeMatSoli;
$person->nombres = $data->nombreSoli;
$person->codVerifica = strval($this->getVerifyCode($dni));

return $person;
Expand Down

0 comments on commit 8975734

Please sign in to comment.