Skip to content

goffyara/sumsub-client

 
 

Repository files navigation

sumsub-client

Build Status codecov PHP 7.1 PHP 7.2 PHP 7.3 PHP 7.4 PHP 8.0 PHP 8.1

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));

About

API client for sumsub.com

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%