-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
176 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM php:7.4-cli | ||
RUN apt-get update && apt-get install unzip | ||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Diia (Дія) API Client for PHP | ||
|
||
## Tests and development | ||
1. Prepare image | ||
```bash | ||
docker build -t diia-php . | ||
``` | ||
2. Install vendors | ||
```bash | ||
docker run --rm -v $(pwd):/app -w /app diia-php composer install | ||
``` | ||
3. Run tests | ||
```bash | ||
docker run --rm -v $(pwd):/app -w /app diia-php vendor/bin/phpunit | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace GrinchenkoUniversity\Diia\Dto\Request; | ||
|
||
class DocumentRequest | ||
{ | ||
private string $branchId; | ||
private string $barcode; | ||
private string $requestId; | ||
private bool $useDiiaId; | ||
|
||
public function __construct( | ||
string $branchId, | ||
string $barcode, | ||
string $requestId, | ||
bool $useDiiaId = true | ||
) { | ||
$this->branchId = $branchId; | ||
$this->barcode = $barcode; | ||
$this->requestId = $requestId; | ||
$this->useDiiaId = $useDiiaId; | ||
} | ||
|
||
public function getBranchId(): string | ||
{ | ||
return $this->branchId; | ||
} | ||
|
||
public function getBarcode(): string | ||
{ | ||
return $this->barcode; | ||
} | ||
|
||
public function getRequestId(): string | ||
{ | ||
return $this->requestId; | ||
} | ||
|
||
public function isUseDiiaId(): bool | ||
{ | ||
return $this->useDiiaId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace GrinchenkoUniversity\Diia\Enum; | ||
|
||
class ScopesDiiaId | ||
{ | ||
public const NAME = 'diiaId'; | ||
|
||
public const SCOPES_ALL = [ | ||
self::SCOPE_HASHED_FILES_SIGNING, | ||
]; | ||
|
||
public const SCOPE_HASHED_FILES_SIGNING = 'hashedFilesSigning'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace GrinchenkoUniversity\Diia\Enum; | ||
|
||
class ScopesSharing | ||
{ | ||
public const NAME = 'sharing'; | ||
|
||
public const SCOPES_ALL = [ | ||
self::SCOPE_INTERNAL_PASSPORT, | ||
self::SCOPE_FOREIGN_PASSPORT, | ||
self::SCOPE_TAXPAYER_CARD, | ||
self::SCOPE_REFERENCE_INTERNALLY_DISPLACED_PERSON, | ||
self::SCOPE_BIRTH_CERTIFICATE, | ||
self::SCOPE_DRIVER_LICENSE, | ||
self::SCOPE_VEHICLE_LICENSE, | ||
self::SCOPE_STUDENT_ID_CARD, | ||
self::SCOPE_EDUCATION_DOCUMENT, | ||
]; | ||
|
||
/** | ||
* Паспорт громадянина України у формі ID-картки | ||
*/ | ||
public const SCOPE_INTERNAL_PASSPORT = 'internal-passport'; | ||
|
||
/** | ||
* Закордонний паспорт | ||
*/ | ||
public const SCOPE_FOREIGN_PASSPORT = 'foreign-passport'; | ||
|
||
/** | ||
* РНОКПП (ІПН) | ||
*/ | ||
public const SCOPE_TAXPAYER_CARD = 'taxpayer-card'; | ||
|
||
/** | ||
* Довідка внутрішньо переміщеної особи (ВПО) | ||
*/ | ||
public const SCOPE_REFERENCE_INTERNALLY_DISPLACED_PERSON = 'reference-internally-displaced-person'; | ||
|
||
/** | ||
* Свідоцтво про народження дитини | ||
*/ | ||
public const SCOPE_BIRTH_CERTIFICATE = 'birth-certificate'; | ||
|
||
/** | ||
* Водійські права | ||
*/ | ||
public const SCOPE_DRIVER_LICENSE = 'driver-license'; | ||
|
||
/** | ||
* Техпаспорт | ||
*/ | ||
public const SCOPE_VEHICLE_LICENSE = 'vehicle-license'; | ||
|
||
/** | ||
* Студентський квиток | ||
*/ | ||
public const SCOPE_STUDENT_ID_CARD = 'student-id-card'; | ||
|
||
/** | ||
* Освітні документи | ||
*/ | ||
public const SCOPE_EDUCATION_DOCUMENT = 'education-document'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters