Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New kyc implementation #1

Merged
merged 9 commits into from
Jul 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Kyc/DocumentTypes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);

namespace Velser\OndatoApiClient\Kyc;

final class DocumentTypes
{
const DOCUMENT_ID_CARD = 1;
const DOCUMENT_PASSPORT = 2;
const DOCUMENT_DRIVER_LICENSE = 3;
}
50 changes: 50 additions & 0 deletions src/Kyc/Entity/FlowData.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);

namespace Velser\OndatoApiClient\Kyc\Entity;


class FlowData
{
private $language;
private $redirectUrl;
private $formType;

public function getLanguage(): string
{
return $this->language;
}

public function setLanguage(string $language): FlowData
{
$this->language = $language;

return $this;
}

public function getRedirectUrl(): ?string
{
return $this->redirectUrl;
}

public function setRedirectUrl(string $redirectUrl): FlowData
{
$this->redirectUrl = $redirectUrl;

return $this;
}

public function getFormType(): ?string
{
return $this->formType;
}

public function setFormType(string $formType): FlowData
{
$this->formType = $formType;

return $this;
}


}
25 changes: 6 additions & 19 deletions src/Kyc/Entity/GetDataRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,17 @@

class GetDataRequest
{
private $apiKey;
private $token;
private $identificationId;

public function getApiKey(): string
public function getIdentificationId(): string
{
return $this->apiKey;
return $this->identificationId;
}

public function setApiKey(string $apiKey): GetDataRequest
public function setIdentificationId(string $identificationId): GetDataRequest
{
$this->apiKey = $apiKey;
$this->identificationId = $token;

return $this;
}

public function getToken(): string
{
return $this->token;
}

public function setToken(string $token): GetDataRequest
{
$this->token = $token;

return $this;
}
}
}
27 changes: 8 additions & 19 deletions src/Kyc/Entity/GetDataResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,35 @@
class GetDataResponse
{
private $status;
private $isCrossChecked;
private $isFoundInSanctionList;
private $failReason;
private $sessionData;
private $parsedDocumentData;

public function getStatus(): int
public function getStatus(): string
{
return $this->status;
}

public function setStatus(int $status): GetDataResponse
public function setStatus(string $status): GetDataResponse
{
$this->status = $status;

return $this;
}

public function getisCrossChecked(): bool
public function getFailReason(): string
{
return $this->isCrossChecked;
return $this->failReason;
}

public function setIsCrossChecked(bool $isCrossChecked): GetDataResponse
public function setFailReason(string $failReason): GetDataResponse
{
$this->isCrossChecked = $isCrossChecked;
$this->failReason = $failReason;

return $this;
}

public function getisFoundInSanctionList(): ?bool
{
return $this->isFoundInSanctionList;
}

public function setIsFoundInSanctionList(bool $isFoundInSanctionList): GetDataResponse
{
$this->isFoundInSanctionList = $isFoundInSanctionList;

return $this;
}

public function getSessionData(): ?SessionData
{
Expand All @@ -70,4 +59,4 @@ public function setParsedDocumentData(ParsedDocumentData $parsedDocumentData): G

return $this;
}
}
}
66 changes: 55 additions & 11 deletions src/Kyc/Entity/ParsedDocumentData.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@

class ParsedDocumentData
{
const DOCUMENT_TYPE_IDENTITY_CARD = 1;
const DOCUMENT_TYPE_PASSPORT = 2;
const DOCUMENT_TYPE_RESIDENCE_PERMIT = 3;
const DOCUMENT_TYPE_DRIVER_LICENCE = 4;
const DOCUMENT_TYPE_LOCAL_PASSPORT = 5;
const DOCUMENT_TYPE_SOCIAL_ID = 6;
const DOCUMENT_TYPE_OTHER = 7;

private $personCode;
private $birthDate;
private $firstName;
private $middleName;
private $lastName;
private $documentNumber;
private $documentType;
private $expireDate;
private $issueDate;
private $country;
private $nationality;
private $gender;
private $address;

public function getPersonCode(): ?string
{
Expand All @@ -35,6 +31,42 @@ public function setPersonCode(string $personCode): ParsedDocumentData
return $this;
}

public function getIssueDate(): string
{
return $this->issueDate;
}

public function setIssueDate($issueDate): ParsedDocumentData
{
$this->issueDate = $issueDate;

return $this;
}

public function getGender(): string
{
return $this->gender;
}

public function setGender($gender): ParsedDocumentData
{
$this->gender = $gender;

return $this;
}

public function getAddress(): string
{
return $this->address;
}

public function setAddress($address): ParsedDocumentData
{
$this->address = $address;

return $this;
}

public function getBirthDate(): ?string
{
return $this->birthDate;
Expand All @@ -59,6 +91,18 @@ public function setFirstName(string $firstName): ParsedDocumentData
return $this;
}

public function geMiddleName(): ?string
{
return $this->firstName;
}

public function setMiddleName(string $firstName): ParsedDocumentData
{
$this->firstName = $firstName;

return $this;
}

public function getLastName(): ?string
{
return $this->lastName;
Expand All @@ -83,12 +127,12 @@ public function setDocumentNumber(string $documentNumber): ParsedDocumentData
return $this;
}

public function getDocumentType(): ?int
public function getDocumentType(): ?string
{
return $this->documentType;
}

public function setDocumentType(int $documentType): ParsedDocumentData
public function setDocumentType(string $documentType): ParsedDocumentData
{
$this->documentType = $documentType;

Expand Down Expand Up @@ -130,4 +174,4 @@ public function setNationality(string $nationality): ParsedDocumentData

return $this;
}
}
}
12 changes: 6 additions & 6 deletions src/Kyc/Entity/SessionData.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class SessionData
private $birthDate;
private $firstName;
private $lastName;
private $personCode;
private $personalIdentityCode;
private $phoneNumber;
private $language;
private $nationality;
Expand Down Expand Up @@ -66,14 +66,14 @@ public function setLastName(string $lastName): SessionData
return $this;
}

public function getPersonCode(): ?string
public function getPersonalIdentityCode(): ?string
{
return $this->personCode;
return $this->personalIdentityCode;
}

public function setPersonCode(string $personCode): SessionData
public function setPersonalIdentityCode(string $personalIdentityCode): SessionData
{
$this->personCode = $personCode;
$this->personalIdentityCode = $personCode;

return $this;
}
Expand Down Expand Up @@ -161,4 +161,4 @@ public function setRefId(string $refId): SessionData

return $this;
}
}
}
25 changes: 6 additions & 19 deletions src/Kyc/Entity/StartSessionRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,8 @@

class StartSessionRequest
{
private $apiKey;
private $sessionData;
private $isVideoCallRequest = false;

public function getApiKey(): string
{
return $this->apiKey;
}

public function setApiKey(string $apiKey): StartSessionRequest
{
$this->apiKey = $apiKey;

return $this;
}
private $flowData;

public function getSessionData(): SessionData
{
Expand All @@ -33,15 +20,15 @@ public function setSessionData(SessionData $sessionData): StartSessionRequest
return $this;
}

public function isVideoCallRequest(): bool
public function getFlowData(): FlowData
{
return $this->isVideoCallRequest;
return $this->flowData;
}

public function setIsVideoCallRequest(bool $isVideoCallRequest): StartSessionRequest
public function setFlowData(FlowData $flowData): StartSessionRequest
{
$this->isVideoCallRequest = $isVideoCallRequest;
$this->flowData = $flowData;

return $this;
}
}
}
27 changes: 21 additions & 6 deletions src/Kyc/Entity/StartSessionResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,32 @@

class StartSessionResponse
{
private $token;
private $identificationId;
private $redirectUrl;

public function getToken(): string
public function getIdentificationId(): string
{
return $this->token;
return $this->identificationId;
}

public function setToken(string $token): StartSessionResponse
public function setIdentificationId($identificationId): StartSessionResponse
{
$this->token = $token;
$this->identificationId = $identificationId;

return $this;
}
}

public function getRedirectUrl(): string
{
return $this->redirectUrl;
}

public function setRedirectUrl(string $redirectUrl): StartSessionResponse
{
$this->redirectUrl = $redirectUrl;

return $this;
}


}
Loading