diff --git a/src/Kyc/Entity/ParsedDocumentData.php b/src/Kyc/Entity/ParsedDocumentData.php index 6ae2bf6..ceb7da7 100644 --- a/src/Kyc/Entity/ParsedDocumentData.php +++ b/src/Kyc/Entity/ParsedDocumentData.php @@ -31,7 +31,7 @@ public function setPersonCode(string $personCode): ParsedDocumentData return $this; } - public function getIssueDate(): string + public function getIssueDate(): ?string { return $this->issueDate; } @@ -43,7 +43,7 @@ public function setIssueDate($issueDate): ParsedDocumentData return $this; } - public function getGender(): string + public function getGender(): ?string { return $this->gender; } @@ -55,7 +55,7 @@ public function setGender($gender): ParsedDocumentData return $this; } - public function getAddress(): string + public function getAddress(): ?string { return $this->address; } @@ -91,14 +91,14 @@ public function setFirstName(string $firstName): ParsedDocumentData return $this; } - public function geMiddleName(): ?string + public function getMiddleName(): ?string { - return $this->firstName; + return $this->middleName; } - public function setMiddleName(string $firstName): ParsedDocumentData + public function setMiddleName(string $middleName): ParsedDocumentData { - $this->firstName = $firstName; + $this->middleName = $middleName; return $this; } diff --git a/src/Kyc/Mapper/ParsedDocumentDataMapper.php b/src/Kyc/Mapper/ParsedDocumentDataMapper.php index 1bb043e..4a3e185 100644 --- a/src/Kyc/Mapper/ParsedDocumentDataMapper.php +++ b/src/Kyc/Mapper/ParsedDocumentDataMapper.php @@ -89,6 +89,10 @@ public function mapFromEntity($entity): array $data['firstName'] = $entity->getFirstName(); } + if ($entity->getMiddleName() !== null) { + $data['middleName'] = $entity->getMiddleName(); + } + if ($entity->getLastName() !== null) { $data['lastName'] = $entity->getLastName(); } @@ -105,6 +109,10 @@ public function mapFromEntity($entity): array $data['expireDate'] = $entity->getExpireDate(); } + if ($entity->getIssueDate() !== null) { + $data['issueDate'] = $entity->getIssueDate(); + } + if ($entity->getCountry() !== null) { $data['country'] = $entity->getCountry(); } @@ -113,6 +121,14 @@ public function mapFromEntity($entity): array $data['nationality'] = $entity->getNationality(); } + if ($entity->getGender() !== null) { + $data['gender'] = $entity->getGender(); + } + + if ($entity->getAddress() !== null) { + $data['address'] = $entity->getAddress(); + } + return $data; } } diff --git a/src/KycApiClient.php b/src/KycApiClient.php index 55e10c0..7b1fa40 100644 --- a/src/KycApiClient.php +++ b/src/KycApiClient.php @@ -50,8 +50,6 @@ public function startSession(StartSessionRequest $startSessionRequest): StartSes return $startSessionMapper->mapToEntity(json_decode($response->getBody()->getContents(), true)); } catch (ClientException $exception) { - $this->handleClientException($exception); - throw $exception; } }