-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathKycIdentityMatches.php
475 lines (375 loc) · 14.5 KB
/
KycIdentityMatches.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
<?php
/**
* This source file is proprietary and part of Rebilly.
*
* (c) Rebilly SRL
* Rebilly Ltd.
* Rebilly Inc.
*
* @see https://www.rebilly.com
*/
declare(strict_types=1);
namespace Rebilly\Sdk\Model;
use DateTimeImmutable;
use DateTimeInterface;
class KycIdentityMatches implements PostKycDocumentMatchesRequest
{
public const DOCUMENT_SUBTYPE_PASSPORT = 'passport';
public const DOCUMENT_SUBTYPE_ID_CARD = 'id-card';
public const DOCUMENT_SUBTYPE_DRIVER_LICENSE = 'driver-license';
public const DOCUMENT_SUBTYPE_BIRTH_CERTIFICATE = 'birth-certificate';
public const DOCUMENT_SUBTYPE_UTILITY_BILL = 'utility-bill';
public const DOCUMENT_SUBTYPE_RENTAL_RECEIPT = 'rental-receipt';
public const DOCUMENT_SUBTYPE_LEASE_AGREEMENT = 'lease-agreement';
public const DOCUMENT_SUBTYPE_COPY_CREDIT_CARD = 'copy-credit-card';
public const DOCUMENT_SUBTYPE_CREDIT_CARD_STATEMENT = 'credit-card-statement';
public const DOCUMENT_SUBTYPE_BANK_STATEMENT = 'bank-statement';
public const DOCUMENT_SUBTYPE_INHERITANCE_DOCUMENTATION = 'inheritance-documentation';
public const DOCUMENT_SUBTYPE_TAX_RETURN = 'tax-return';
public const DOCUMENT_SUBTYPE_SALARY_SLIP = 'salary-slip';
public const DOCUMENT_SUBTYPE_SALE_OF_ASSETS = 'sale-of-assets';
public const DOCUMENT_SUBTYPE_PUBLIC_HEALTH_CARD = 'public-health-card';
public const DOCUMENT_SUBTYPE_PROOF_OF_AGE_CARD = 'proof-of-age-card';
public const DOCUMENT_SUBTYPE_REVERSE_OF_ID = 'reverse-of-id';
public const DOCUMENT_SUBTYPE_PUBLIC_SERVICE = 'public-service';
public const DOCUMENT_SUBTYPE_EWALLET_HOLDER_DETAILS = 'ewallet-holder-details';
public const DOCUMENT_SUBTYPE_EWALLET_TRANSACTION_STATEMENT = 'ewallet-transaction-statement';
public const DOCUMENT_SUBTYPE_MARRIAGE_CERTIFICATE = 'marriage-certificate';
public const DOCUMENT_SUBTYPE_FIREARMS_LICENSE = 'firearms-license';
public const DOCUMENT_SUBTYPE_INSURANCE_LETTER = 'insurance-letter';
public const DOCUMENT_SUBTYPE_INCOME_STATEMENT = 'income-statement';
public const DOCUMENT_SUBTYPE_DEBTORS_LETTER = 'debtors-letter';
public const DOCUMENT_SUBTYPE_OTHER = 'other';
public const DOCUMENT_SUBTYPE_NULL = 'null';
private array $fields = [];
public function __construct(array $data = [])
{
if (array_key_exists('containsImage', $data)) {
$this->setContainsImage($data['containsImage']);
}
if (array_key_exists('isIdentityDocument', $data)) {
$this->setIsIdentityDocument($data['isIdentityDocument']);
}
if (array_key_exists('isPublishedOnline', $data)) {
$this->setIsPublishedOnline($data['isPublishedOnline']);
}
if (array_key_exists('matchingImages', $data)) {
$this->setMatchingImages($data['matchingImages']);
}
if (array_key_exists('firstName', $data)) {
$this->setFirstName($data['firstName']);
}
if (array_key_exists('lastName', $data)) {
$this->setLastName($data['lastName']);
}
if (array_key_exists('dateOfBirth', $data)) {
$this->setDateOfBirth($data['dateOfBirth']);
}
if (array_key_exists('expirationDate', $data)) {
$this->setExpirationDate($data['expirationDate']);
}
if (array_key_exists('issueDate', $data)) {
$this->setIssueDate($data['issueDate']);
}
if (array_key_exists('hasMinimalAge', $data)) {
$this->setHasMinimalAge($data['hasMinimalAge']);
}
if (array_key_exists('nationality', $data)) {
$this->setNationality($data['nationality']);
}
if (array_key_exists('issuanceCountry', $data)) {
$this->setIssuanceCountry($data['issuanceCountry']);
}
if (array_key_exists('issuanceRegion', $data)) {
$this->setIssuanceRegion($data['issuanceRegion']);
}
if (array_key_exists('documentNumber', $data)) {
$this->setDocumentNumber($data['documentNumber']);
}
if (array_key_exists('documentSubtype', $data)) {
$this->setDocumentSubtype($data['documentSubtype']);
}
if (array_key_exists('hasMatchingFaceProof', $data)) {
$this->setHasMatchingFaceProof($data['hasMatchingFaceProof']);
}
if (array_key_exists('isTampered', $data)) {
$this->setIsTampered($data['isTampered']);
}
if (array_key_exists('isDigitallyTampered', $data)) {
$this->setIsDigitallyTampered($data['isDigitallyTampered']);
}
if (array_key_exists('hasCompletedFaceLiveness', $data)) {
$this->setHasCompletedFaceLiveness($data['hasCompletedFaceLiveness']);
}
if (array_key_exists('expiryDate', $data)) {
$this->setExpiryDate($data['expiryDate']);
}
}
public static function from(array $data = []): self
{
return new self($data);
}
public function getContainsImage(): ?bool
{
return $this->fields['containsImage'] ?? null;
}
public function setContainsImage(null|bool $containsImage): static
{
$this->fields['containsImage'] = $containsImage;
return $this;
}
public function getIsIdentityDocument(): ?bool
{
return $this->fields['isIdentityDocument'] ?? null;
}
public function setIsIdentityDocument(null|bool $isIdentityDocument): static
{
$this->fields['isIdentityDocument'] = $isIdentityDocument;
return $this;
}
public function getIsPublishedOnline(): ?bool
{
return $this->fields['isPublishedOnline'] ?? null;
}
public function setIsPublishedOnline(null|bool $isPublishedOnline): static
{
$this->fields['isPublishedOnline'] = $isPublishedOnline;
return $this;
}
/**
* @return null|string[]
*/
public function getMatchingImages(): ?array
{
return $this->fields['matchingImages'] ?? null;
}
public function getFirstName(): ?string
{
return $this->fields['firstName'] ?? null;
}
public function setFirstName(null|string $firstName): static
{
$this->fields['firstName'] = $firstName;
return $this;
}
public function getLastName(): ?string
{
return $this->fields['lastName'] ?? null;
}
public function setLastName(null|string $lastName): static
{
$this->fields['lastName'] = $lastName;
return $this;
}
public function getDateOfBirth(): ?DateTimeImmutable
{
return $this->fields['dateOfBirth'] ?? null;
}
public function setDateOfBirth(null|DateTimeImmutable|string $dateOfBirth): static
{
if ($dateOfBirth !== null && !($dateOfBirth instanceof DateTimeImmutable)) {
$dateOfBirth = new DateTimeImmutable($dateOfBirth);
}
$this->fields['dateOfBirth'] = $dateOfBirth;
return $this;
}
public function getExpirationDate(): ?DateTimeImmutable
{
return $this->fields['expirationDate'] ?? null;
}
public function setExpirationDate(null|DateTimeImmutable|string $expirationDate): static
{
if ($expirationDate !== null && !($expirationDate instanceof DateTimeImmutable)) {
$expirationDate = new DateTimeImmutable($expirationDate);
}
$this->fields['expirationDate'] = $expirationDate;
return $this;
}
public function getIssueDate(): ?DateTimeImmutable
{
return $this->fields['issueDate'] ?? null;
}
public function setIssueDate(null|DateTimeImmutable|string $issueDate): static
{
if ($issueDate !== null && !($issueDate instanceof DateTimeImmutable)) {
$issueDate = new DateTimeImmutable($issueDate);
}
$this->fields['issueDate'] = $issueDate;
return $this;
}
public function getHasMinimalAge(): ?bool
{
return $this->fields['hasMinimalAge'] ?? null;
}
public function getNationality(): ?string
{
return $this->fields['nationality'] ?? null;
}
public function setNationality(null|string $nationality): static
{
$this->fields['nationality'] = $nationality;
return $this;
}
public function getIssuanceCountry(): ?string
{
return $this->fields['issuanceCountry'] ?? null;
}
public function setIssuanceCountry(null|string $issuanceCountry): static
{
$this->fields['issuanceCountry'] = $issuanceCountry;
return $this;
}
public function getIssuanceRegion(): ?string
{
return $this->fields['issuanceRegion'] ?? null;
}
public function setIssuanceRegion(null|string $issuanceRegion): static
{
$this->fields['issuanceRegion'] = $issuanceRegion;
return $this;
}
public function getDocumentNumber(): ?string
{
return $this->fields['documentNumber'] ?? null;
}
public function setDocumentNumber(null|string $documentNumber): static
{
$this->fields['documentNumber'] = $documentNumber;
return $this;
}
public function getDocumentSubtype(): ?string
{
return $this->fields['documentSubtype'] ?? null;
}
public function setDocumentSubtype(null|string $documentSubtype): static
{
$this->fields['documentSubtype'] = $documentSubtype;
return $this;
}
public function getHasMatchingFaceProof(): ?bool
{
return $this->fields['hasMatchingFaceProof'] ?? null;
}
public function setHasMatchingFaceProof(null|bool $hasMatchingFaceProof): static
{
$this->fields['hasMatchingFaceProof'] = $hasMatchingFaceProof;
return $this;
}
public function getIsTampered(): ?bool
{
return $this->fields['isTampered'] ?? null;
}
public function setIsTampered(null|bool $isTampered): static
{
$this->fields['isTampered'] = $isTampered;
return $this;
}
public function getIsDigitallyTampered(): ?bool
{
return $this->fields['isDigitallyTampered'] ?? null;
}
public function setIsDigitallyTampered(null|bool $isDigitallyTampered): static
{
$this->fields['isDigitallyTampered'] = $isDigitallyTampered;
return $this;
}
public function getHasCompletedFaceLiveness(): ?bool
{
return $this->fields['hasCompletedFaceLiveness'] ?? null;
}
public function getExpiryDate(): ?DateTimeImmutable
{
return $this->fields['expiryDate'] ?? null;
}
public function setExpiryDate(null|DateTimeImmutable|string $expiryDate): static
{
if ($expiryDate !== null && !($expiryDate instanceof DateTimeImmutable)) {
$expiryDate = new DateTimeImmutable($expiryDate);
}
$this->fields['expiryDate'] = $expiryDate;
return $this;
}
public function jsonSerialize(): array
{
$data = [];
if (array_key_exists('containsImage', $this->fields)) {
$data['containsImage'] = $this->fields['containsImage'];
}
if (array_key_exists('isIdentityDocument', $this->fields)) {
$data['isIdentityDocument'] = $this->fields['isIdentityDocument'];
}
if (array_key_exists('isPublishedOnline', $this->fields)) {
$data['isPublishedOnline'] = $this->fields['isPublishedOnline'];
}
if (array_key_exists('matchingImages', $this->fields)) {
$data['matchingImages'] = $this->fields['matchingImages'];
}
if (array_key_exists('firstName', $this->fields)) {
$data['firstName'] = $this->fields['firstName'];
}
if (array_key_exists('lastName', $this->fields)) {
$data['lastName'] = $this->fields['lastName'];
}
if (array_key_exists('dateOfBirth', $this->fields)) {
$data['dateOfBirth'] = $this->fields['dateOfBirth']?->format(DateTimeInterface::RFC3339);
}
if (array_key_exists('expirationDate', $this->fields)) {
$data['expirationDate'] = $this->fields['expirationDate']?->format(DateTimeInterface::RFC3339);
}
if (array_key_exists('issueDate', $this->fields)) {
$data['issueDate'] = $this->fields['issueDate']?->format(DateTimeInterface::RFC3339);
}
if (array_key_exists('hasMinimalAge', $this->fields)) {
$data['hasMinimalAge'] = $this->fields['hasMinimalAge'];
}
if (array_key_exists('nationality', $this->fields)) {
$data['nationality'] = $this->fields['nationality'];
}
if (array_key_exists('issuanceCountry', $this->fields)) {
$data['issuanceCountry'] = $this->fields['issuanceCountry'];
}
if (array_key_exists('issuanceRegion', $this->fields)) {
$data['issuanceRegion'] = $this->fields['issuanceRegion'];
}
if (array_key_exists('documentNumber', $this->fields)) {
$data['documentNumber'] = $this->fields['documentNumber'];
}
if (array_key_exists('documentSubtype', $this->fields)) {
$data['documentSubtype'] = $this->fields['documentSubtype'];
}
if (array_key_exists('hasMatchingFaceProof', $this->fields)) {
$data['hasMatchingFaceProof'] = $this->fields['hasMatchingFaceProof'];
}
if (array_key_exists('isTampered', $this->fields)) {
$data['isTampered'] = $this->fields['isTampered'];
}
if (array_key_exists('isDigitallyTampered', $this->fields)) {
$data['isDigitallyTampered'] = $this->fields['isDigitallyTampered'];
}
if (array_key_exists('hasCompletedFaceLiveness', $this->fields)) {
$data['hasCompletedFaceLiveness'] = $this->fields['hasCompletedFaceLiveness'];
}
if (array_key_exists('expiryDate', $this->fields)) {
$data['expiryDate'] = $this->fields['expiryDate']?->format(DateTimeInterface::RFC3339);
}
return $data;
}
/**
* @param null|string[] $matchingImages
*/
private function setMatchingImages(null|array $matchingImages): static
{
$this->fields['matchingImages'] = $matchingImages;
return $this;
}
private function setHasMinimalAge(null|bool $hasMinimalAge): static
{
$this->fields['hasMinimalAge'] = $hasMinimalAge;
return $this;
}
private function setHasCompletedFaceLiveness(null|bool $hasCompletedFaceLiveness): static
{
$this->fields['hasCompletedFaceLiveness'] = $hasCompletedFaceLiveness;
return $this;
}
}