PHP code example of trustswiftly / trustswiftly-php-sdk

1. Go to this page and download the library: Download trustswiftly/trustswiftly-php-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

trustswiftly / trustswiftly-php-sdk example snippets


$trustObject = new TrustSwiftly\TrustSwiftly($api_key, $base_url, $api_secret, $embed_key);

$validationResponse = TrustSwiftly\TrustSwiftly::validateCredentials($key,$base_url,$api_secret,$embed_key);

$filterAndSortOptions=[
        'per_page'=>2
    ];
$userData=$trustObject->userClient()->getAllUsers($filterAndSortOptions);

$userDetails=$trustObject->userClient()->getUserDetails($user_id);

$user=$userDetails->user();

$user=$userDetails->userVerifications();

$userData = [
        'email'=>'[email protected]'
    ];
$userCreateData = $trustObject->userClient()->createUser($userData);

$updateData=[
        'first_name'=>'asd'
    ];
$userDetails=$trustObject->userClient()->updateUser($user_id,$updateData);

$updateData=[
        'verification_id'=>xx,
        'status'=>xx
    ];
$userVerificationData=$trustObject->userClient()->updateUserVerification($user_id,$updateData);

$userDetails=$trustObject->userClient()->deleteUser($user_id);

$userDetails=$trustObject->userClient()->getMagicLink($user_id);

$templateData=$trustObject->templateClient()->getVerificationTemplates();

$statData=$trustObject->statisticsClient()->getVerificationStats();

$embedSignature=$trustObject->getEmbedSignature($user_id);

$result=TrustSwiftly\TrustSwiftly::verifyWebhookSignature($receivedSignature,file_get_contents("php://input"),$signatureSecret);

composer 

"trustswiftly/trustswiftly-php-sdk": "^1.0"