Skip to content

Commit

Permalink
Merge branch 'SDK-2265' into SDK-2377-php-add-failure-reason-info-to-…
Browse files Browse the repository at this point in the history
…idv-get-session-results
  • Loading branch information
mehmet-yoti authored Jun 21, 2024
2 parents 3bb1f1b + e1fdcd5 commit 8271c28
Show file tree
Hide file tree
Showing 27 changed files with 211 additions and 186 deletions.
17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Yoti Support
url: https://support.yoti.com/yotisupport/s/contactsupport
about: Please send your questions or issues here.
2 changes: 1 addition & 1 deletion .php-cs-fixer.cache

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The Yoti SDK can be used for the following products, follow the links for more i

## Support

For any questions or support please email [[email protected]](mailto:clientsupport@yoti.com).
For any questions or support please contact us here: https://support.yoti.com
Please provide the following to get you up and working as quickly as possible:

* Computer type
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yoti/yoti-php-sdk",
"description": "Yoti SDK for quickly integrating your PHP backend with Yoti",
"version": "4.2.0",
"version": "4.2.2",
"keywords": [
"yoti",
"sdk"
Expand Down
3 changes: 3 additions & 0 deletions examples/doc-scan/app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public function show(Request $request, DocScanClient $client)
(new RequestedTextExtractionTaskBuilder())
->withManualCheckAlways()
->withChipDataDesired()
->withCreateExpandedDocumentFields(true)
->build()
)
->withRequestedTask(
Expand All @@ -136,6 +137,7 @@ public function show(Request $request, DocScanClient $client)
->withSuccessUrl(config('app.url') . '/success')
->withErrorUrl(config('app.url') . '/error')
->withPrivacyPolicyUrl(config('app.url') . '/privacy-policy')
->withBiometricConsentFlow('EARLY')
->build()
)
->withRequiredDocument(
Expand All @@ -160,6 +162,7 @@ public function show(Request $request, DocScanClient $client)
)
->build();


$session = $client->createSession($sessionSpec);

$request->session()->put('YOTI_SESSION_ID', $session->getSessionId());
Expand Down
35 changes: 35 additions & 0 deletions examples/doc-scan/resources/views/success.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,41 @@ class="badge badge-primary">{{ $document->getIssuingCountry() }}</span></h3>
</div>
@endif

@if ($document->getExpandedDocumentFields())
<div class="card">
<div class="card-header" id="expanded-document-fields-{{ $docNum }}">
<h4 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse"
data-target="#collapse-expanded-document-fields-{{ $docNum }}"
aria-expanded="true"
aria-controls="collapse-expanded-document-fields-{{ $docNum }}">
Expanded Document Fields
</button>
</h4>
</div>
<div id="collapse-expanded-document-fields-{{ $docNum }}" class="collapse"
aria-labelledby="expanded-document-fields-{{ $docNum }}">
<div class="card-body">
@if ($document->getExpandedDocumentFields()->getMedia())
<h5>Media</h5>
<table class="table table-striped table-light">
<tbody>
<tr>
<td>ID</td>
<td>
<a href="/media/{{ $document->getExpandedDocumentFields()->getMedia()->getId() }}">
{{ $document->getExpandedDocumentFields()->getMedia()->getId() }}
</a>
</td>
</tr>
</tbody>
</table>
@endif
</div>
</div>
</div>
@endif

@if ($document->getDocumentIdPhoto())
<div class="card">
<div class="card-header" id="document-id-photo-{{ $docNum }}">
Expand Down
64 changes: 0 additions & 64 deletions examples/profile/app/Http/Controllers/IdentityController.php

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion examples/profile/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@
* Application Service Providers...
*/
App\Providers\YotiServiceProvider::class,
App\Providers\YotiDigitalIdentityServiceProvider::class,
App\Providers\RouteServiceProvider::class,
],

Expand Down
60 changes: 0 additions & 60 deletions examples/profile/resources/views/identity.blade.php

This file was deleted.

3 changes: 2 additions & 1 deletion examples/profile/resources/views/partial/report.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</tr>
</thead>
<tbody>
@if (isset($value) && is_array($value))
@foreach ($value as $name => $result)
@if (is_array($result))
@foreach ($result as $data => $view)
Expand All @@ -33,7 +34,7 @@
</tr>
@endif
@endforeach

@endif
</tbody>
</table>
@endforeach
1 change: 0 additions & 1 deletion examples/profile/routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@
Route::get('/dynamic-share', 'DynamicShareController@show');

Route::get('/dbs-check', 'DbsCheckController@show');
Route::get('/generate-share', 'IdentityController@show');
2 changes: 1 addition & 1 deletion src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Constants
public const SDK_IDENTIFIER = 'PHP';

/** Default SDK version */
public const SDK_VERSION = '4.2.0';
public const SDK_VERSION = '4.2.2';

/** Base url for connect page (user will be redirected to this page eg. baseurl/app-id) */
public const CONNECT_BASE_URL = 'https://www.yoti.com/connect';
Expand Down
19 changes: 18 additions & 1 deletion src/DocScan/Session/Create/SdkConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ class SdkConfig implements \JsonSerializable
*/
private $attemptsConfiguration;

/**
* @var string|null
*/
private $biometricConsentFlow;

/**
* @param string|null $allowedCaptureMethods
* @param string|null $primaryColour
Expand All @@ -75,6 +80,7 @@ class SdkConfig implements \JsonSerializable
* @param string|null $privacyPolicyUrl
* @param bool|null $allowHandoff
* @param array<string, int>|null $idDocumentTextDataExtractionRetriesConfig
* @param string|null $biometricConsentFlow
*/
public function __construct(
?string $allowedCaptureMethods,
Expand All @@ -87,7 +93,8 @@ public function __construct(
?string $errorUrl,
?string $privacyPolicyUrl = null,
?bool $allowHandoff = null,
?array $idDocumentTextDataExtractionRetriesConfig = null
?array $idDocumentTextDataExtractionRetriesConfig = null,
?string $biometricConsentFlow = null
) {
$this->allowedCaptureMethods = $allowedCaptureMethods;
$this->primaryColour = $primaryColour;
Expand All @@ -102,6 +109,7 @@ public function __construct(
if (!is_null($idDocumentTextDataExtractionRetriesConfig)) {
$this->attemptsConfiguration = new AttemptsConfiguration($idDocumentTextDataExtractionRetriesConfig);
}
$this->biometricConsentFlow = $biometricConsentFlow;
}

/**
Expand All @@ -121,6 +129,7 @@ public function jsonSerialize(): \stdClass
'privacy_policy_url' => $this->getPrivacyPolicyUrl(),
'allow_handoff' => $this->getAllowHandoff(),
'attempts_configuration' => $this->getAttemptsConfiguration(),
'biometric_consent_flow' => $this->getBiometricConsentFlow()
]);
}

Expand Down Expand Up @@ -211,4 +220,12 @@ public function getAttemptsConfiguration(): ?AttemptsConfiguration
{
return $this->attemptsConfiguration;
}

/**
* @return string|null
*/
public function getBiometricConsentFlow(): ?string
{
return $this->biometricConsentFlow;
}
}
13 changes: 12 additions & 1 deletion src/DocScan/Session/Create/SdkConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ class SdkConfigBuilder
*/
private $idDocumentTextDataExtractionRetriesConfig;

/**
* @var string|null
*/
private $biometricConsentFlow;

public function withAllowsCamera(): self
{
return $this->withAllowedCaptureMethod(self::CAMERA);
Expand Down Expand Up @@ -136,6 +141,11 @@ public function withAllowHandoff(bool $allowHandoff): self
return $this;
}

public function withBiometricConsentFlow(string $biometricConsentFlow): self
{
$this->biometricConsentFlow = $biometricConsentFlow;
return $this;
}
/**
* Allows configuring the number of attempts permitted for text extraction on an ID document
*
Expand Down Expand Up @@ -203,7 +213,8 @@ public function build(): SdkConfig
$this->errorUrl,
$this->privacyPolicyUrl,
$this->allowHandoff,
$this->idDocumentTextDataExtractionRetriesConfig
$this->idDocumentTextDataExtractionRetriesConfig,
$this->biometricConsentFlow
);
}
}
Loading

0 comments on commit 8271c28

Please sign in to comment.