alexeevdv / sumsub-client
API client for sumsub.com
Installs: 10 198
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 6
Open Issues: 1
Requires
- php: >=7.1
- ext-json: *
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
Requires (Dev)
- codeception/codeception: ^4.1
- codeception/module-asserts: ^1.3
- guzzlehttp/psr7: ^1.6
- symplify/easy-coding-standard: ^10.2
This package is auto-updated.
Last update: 2024-10-29 06:18:39 UTC
README
API client for sumsub.com
Installation
composer require alexeevdv/sumsub-client
Client configuration
Client works with any PSR-18 compatible HTTP client and require PSR-17 HTTP factory.
use alexeevdv\SumSub\Client; use alexeevdv\SumSub\Request\RequestSigner; $requestSigner = new RequestSigner('Your APP token', 'Your secret'); $client = new Client( $psr18HttpClient, $psr17HttpFactory, $requestSigner );
Getting SDKs access token
use alexeevdv\SumSub\Request\AccessTokenRequest; $externalUserId = 'some-id'; $levelName = 'some-level'; $ttlInSeconds = 3600; $response = $client->getAccessToken(new AccessTokenRequest($externalUserId, $levelName, $ttlInSeconds)); $accessToken = $response->getToken();
Getting applicant data by applicant id
use alexeevdv\SumSub\Request\ApplicantDataRequest; $applicantId = 'some-id'; $response = $client->getApplicantData(new ApplicantDataRequest($applicantId)); $applicantData = $response->asArray();
Getting applicant data by external user id
use alexeevdv\SumSub\Request\ApplicantDataRequest; $externalUserId = 'some-id'; $response = $client->getApplicantData(new ApplicantDataRequest(null, $externalUserId)); $applicantData = $response->asArray();
Resetting an applicant
use alexeevdv\SumSub\Request\ResetApplicantRequest; $applicantId = 'some-id'; $client->resetApplicant(new ResetApplicantRequest($applicantId));
Getting applicant status
use alexeevdv\SumSub\Request\ApplicantStatusRequest; $applicantId = 'some-id'; $response = $client->getApplicantStatus(new ApplicantStatusRequest($applicantId)); $applicantStatus = $response->asArray();
Getting document images
use alexeevdv\SumSub\Request\DocumentImageRequest; $inspectionId = 'some-id'; $imageId = '123'; $response = $client->getDocumentImages(new DocumentImageRequest($inspectionId, $imageId)); $stream = $response->asStream(); $conentType = $response->getContentType();
Getting inspection checks
use alexeevdv\SumSub\Request\InspectionChecksRequest; $inspectionId = 'some-id'; $response = $client->getInspectionChecks(new InspectionChecksRequest($inspectionId)); $checksData = $response->asArray();