Skip to content

Commit

Permalink
updated changes for failure details
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmet-yoti committed Jul 25, 2024
1 parent f179e48 commit d743972
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
14 changes: 14 additions & 0 deletions examples/doc-scan/app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,22 @@ public function show(Request $request, DocScanClient $client)
->build();


//Identity Profile Requeirements
/*$identityProfileRequirements = (object)[
'trust_framework' => 'UK_TFIDA',
'scheme' => [
'type' => 'DBS',
'objective' => 'BASIC'
]
];*/

$sessionSpec = (new SessionSpecificationBuilder())
->withClientSessionTokenTtl(600)
->withResourcesTtl(90000)
->withUserTrackingId('some-user-tracking-id')
->withBlockBiometricConsent(false) //User needs to provide consent for the liveness detection
//For Identity Profile Requirements
//->withIdentityProfileRequirements($identityProfileRequirements)
->withRequestedCheck(
(new RequestedDocumentAuthenticityCheckBuilder())
->build()
Expand Down Expand Up @@ -140,6 +152,7 @@ public function show(Request $request, DocScanClient $client)
->withBiometricConsentFlow('EARLY')
->build()
)
/*
->withRequiredDocument(
(new RequiredIdDocumentBuilder())
->withFilter(
Expand All @@ -160,6 +173,7 @@ public function show(Request $request, DocScanClient $client)
)
->build()
)
*/
->build();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class SuccessController extends BaseController
public function show(Request $request, DocScanClient $client)
{
return view('success', [
'sessionResult' => $client->getSession('894a51f1-f8fc-4986-85e7-fb8a56d61388'),
'sessionResult' => $client->getSession($request->session()->get('YOTI_SESSION_ID')),
]);
}
}
6 changes: 5 additions & 1 deletion examples/doc-scan/resources/views/success.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@
</div>
</div>
@endif
@if ($sessionResult->getIdentityProfile())
@if (isset($sessionResult))
@if ($sessionResult->getIdentityProfile() != null)
@if ($sessionResult->getIdentityProfile()->getFailureReason() != null)
@if ($sessionResult->getIdentityProfile()->getFailureReason()->getReasonCode())
<div class="row pt-4">
<div class="col">
Expand Down Expand Up @@ -341,6 +343,8 @@
</tr>
</tbody>
</table>
@endif
@endif
@endif
@endif
@endif
Expand Down
5 changes: 4 additions & 1 deletion src/DocScan/Session/Retrieve/GetSessionResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ function ($checkResponse) use ($class): bool {

public function getIdentityProfile(): ?IdentityProfileResponse
{
return $this->identityProfile;
if(isset($this->identityProfile))
return $this->identityProfile;
else
return null;
}

public function getIdentityProfilePreview(): ?IdentityProfilePreviewResponse
Expand Down
2 changes: 1 addition & 1 deletion src/DocScan/Session/Retrieve/IdentityProfileResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getResult(): string
/**
* @return FailureReasonResponse
*/
public function getFailureReason(): FailureReasonResponse
public function getFailureReason(): ?FailureReasonResponse
{
return $this->failureReason;
}
Expand Down

0 comments on commit d743972

Please sign in to comment.