Skip to content

Releases: getyoti/yoti-php-sdk-sandbox

1.6.0

17 Jun 12:22
Compare
Choose a tag to compare

Added

Identity Verification (Doc Scan)

  • 3rd Party Identity Checks
    • Add to session with:
$sessionSpec = (new SessionSpecificationBuilder())
          ->withRequestedCheck(
         (new RequestedThirdPartyIdentityCheckBuilder())
          ->build())
  • Retrieve results with:
GetSessionResult->GetThirdPartyIdentityChecks()

1.5.0

04 Nov 17:13
f8c6ec2
Compare
Choose a tag to compare

Doc Scan

Added

  • Supplementary Document Support
  • Support for setting in session feedback

1.4.0

05 Oct 16:07
dab51a6
Compare
Choose a tag to compare

Added

  • Document comparison support
  • Document ID photo support

Fixed

  • Exclude document_fields from JSON when not set

1.3.0

07 Jul 13:57
d84e7f3
Compare
Choose a tag to compare

Added

  • Support for document images

Fixed

  • SandboxDocScanException now includes formatted error response when available

1.2.0

18 Jun 11:40
ed04c6f
Compare
Choose a tag to compare

Added

  • Support for 3rd party attributes

Example

<?php
$extraData = (new SandboxExtraDataBuilder())
    ->withDataEntry(
        (new SandboxAttributeIssuanceDetailsBuilder())
            ->withDefinition('some-definition')
            ->withExpiryDate(new \DateTime('+1 day'))
            ->withIssuanceToken('some-token')
            ->build()
    )
    ->build();

$tokenRequest = (new TokenRequestBuilder())
    ->setRememberMeId('some-remember-me-id')
    ->setExtraData($extraData)
    ->build();

1.1.0

29 May 10:28
fed64a4
Compare
Choose a tag to compare

Added

  • Doc Scan sandbox support

Deprecated

  • Boolean argument 4 passed to Yoti\Sandbox\Profile\Request\Attribute\SandboxAttribute::__construct is deprecated and should be removed before 2.0.0
  • Boolean argument 2 passed to Yoti\Sandbox\Profile\Request\TokenRequestBuilder set methods is deprecated and should be removed before 2.0.0

Doc Scan Example

<?php

use Yoti\Sandbox\DocScan\Request\Check\Report\SandboxBreakdownBuilder;
use Yoti\Sandbox\DocScan\Request\Check\Report\SandboxRecommendationBuilder;
use Yoti\Sandbox\DocScan\Request\Check\SandboxDocumentAuthenticityCheckBuilder;
use Yoti\Sandbox\DocScan\Request\Check\SandboxDocumentFaceMatchCheckBuilder;
use Yoti\Sandbox\DocScan\Request\Check\SandboxDocumentTextDataCheckBuilder;
use Yoti\Sandbox\DocScan\Request\Check\SandboxZoomLivenessCheckBuilder;
use Yoti\Sandbox\DocScan\Request\SandboxCheckReportsBuilder;
use Yoti\Sandbox\DocScan\Request\SandboxDocumentFilterBuilder;
use Yoti\Sandbox\DocScan\Request\SandboxResponseConfigBuilder;
use Yoti\Sandbox\DocScan\Request\SandboxTaskResultsBuilder;
use Yoti\Sandbox\DocScan\Request\Task\SandboxDocumentTextDataExtractionTaskBuilder;
use Yoti\Sandbox\DocScan\SandboxClient;

$documentFilter = (new SandboxDocumentFilterBuilder())
    ->withCountryCode('GBR')
    ->withDocumentType('PASSPORT')
    ->build();

$responseConfig = (new SandboxResponseConfigBuilder())
    ->withCheckReports(
        (new SandboxCheckReportsBuilder())
            ->withAsyncReportDelay(10)
            ->withDocumentAuthenticityCheck(
                (new SandboxDocumentAuthenticityCheckBuilder())
                    ->withBreakdown(
                        (new SandboxBreakdownBuilder())
                            ->withSubCheck('security_features')
                            ->withResult('NOT_AVAILABLE')
                            ->withDetail('some_detail', 'some_detail_value')
                            ->build()
                    )
                    ->withRecommendation(
                        (new SandboxRecommendationBuilder())
                            ->withValue('NOT_AVAILABLE')
                            ->withReason('PICTURE_TOO_DARK')
                            ->withRecoverySuggestion('BETTER_LIGHTING')
                            ->build()
                    )
                    ->withDocumentFilter($documentFilter)
                    ->build()
            )
            ->withDocumentFaceMatchCheck(
                (new SandboxDocumentFaceMatchCheckBuilder())
                    ->withBreakdown(
                        (new SandboxBreakdownBuilder())
                            ->withSubCheck('security_features')
                            ->withResult('PASS')
                            ->build()
                    )
                    ->withRecommendation(
                        (new SandboxRecommendationBuilder())
                            ->withValue('APPROVE')
                            ->build()
                    )
                    ->withDocumentFilter($documentFilter)
                    ->build()
            )
            ->withDocumentTextDataCheck(
                (new SandboxDocumentTextDataCheckBuilder())
                    ->withBreakdown(
                        (new SandboxBreakdownBuilder())
                            ->withSubCheck('document_in_date')
                            ->withResult('PASS')
                            ->build()
                    )
                    ->withRecommendation(
                        (new SandboxRecommendationBuilder())
                            ->withValue('APPROVE')
                            ->build()
                    )
                    ->withDocumentFilter($documentFilter)
                    ->withDocumentFields([
                        'full_name' => 'John Doe',
                        'nationality' => 'GBR',
                        'date_of_birth' => '1986-06-01',
                        'document_number' => '123456789',
                    ])
                    ->build()
            )
            ->withLivenessCheck(
                (new SandboxZoomLivenessCheckBuilder())
                    ->withBreakdown(
                        (new SandboxBreakdownBuilder())
                            ->withSubCheck('security_features')
                            ->withResult('PASS')
                            ->build()
                    )
                    ->withRecommendation(
                        (new SandboxRecommendationBuilder())
                            ->withValue('APPROVE')
                            ->build()
                    )
                    ->build()
            )
            ->build()
    )
    ->withTaskResults(
        (new SandboxTaskResultsBuilder())
            ->withDocumentTextDataExtractionTask(
                (new SandboxDocumentTextDataExtractionTaskBuilder())
                    ->withDocumentFields([
                        'full_name' => 'John Doe',
                        'nationality' => 'GBR',
                        'date_of_birth' => '1986-06-01',
                        'document_number' => '123456789',
                    ])
                    ->withDocumentFilter($documentFilter)
                    ->build()
            )
            ->build()
    )
    ->build();

$client = new SandboxClient('SANDBOX_CLIENT_SDK_ID', '/path/to/your-pem-file.pem');
$client->configureSessionResponse('SESSION_ID', $responseConfig);

1.0.0

20 Mar 17:43
f45d7da
Compare
Choose a tag to compare

Added

  • Sandbox Service
    • Yoti\Sandbox\Profile\SandboxClient::setupSharingProfile() to interact with the Sandbox service and create a token for the specified profile

Example

<?php
use Yoti\Sandbox\Profile\SandboxClient;
use Yoti\Sandbox\Profile\Request\TokenRequestBuilder;
use Yoti\Sandbox\Profile\Request\Attribute\SandboxAgeVerification;

try {
    $sandboxClient = new SandboxClient('CLIENT_SDK_ID', '/path/to/your-pem-file.pem');

    $ageVerification = SandboxAgeVerification::forAgeOver(
        18,
        new \DateTime('1980-01-01')
    );

    $tokenRequest = (new TokenRequestBuilder())
        ->setRememberMeId('some remember me ID')
        ->setGivenNames('some given names')
        ->setFamilyName('some family name')
        ->setFullName('some full name')
        ->setDateOfBirth(new \DateTime('1980-01-01'))
        ->setAgeVerification($ageVerification)
        ->setGender('some gender')
        ->setPhoneNumber('some phone number')
        ->setNationality('some nationality')
        ->setStructuredPostalAddress(json_encode([
            'building_number' => 1,
            'address_line1' => 'some address',
        ]))
        ->setBase64Selfie('some base64 encoded selfie')
        ->setEmailAddress('some@email')
        ->setDocumentDetailsWithString('PASSPORT USA 1234abc')
        ->build();

    $token = $sandboxClient->setupSharingProfile($tokenRequest)->getToken();
    $client = new \Yoti\YotiClient('CLIENT_SDK_ID', '/path/to/your-pem-file.pem', [
        'api.url' => 'https://api.yoti.com/sandbox/v1'
    ]);
    $activityDetails = $client->getActivityDetails($token);
} catch(Exception $e) {
    // Handle unhappy path
}