PHP code example of softan / connect-php-sdk

1. Go to this page and download the library: Download softan/connect-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/ */

    

softan / connect-php-sdk example snippets



SoftanConnect\Services;

$userId = 12345;
$resCreate = Services::requestToken(["user_id" => $userId]);

$token = $resCreate['data']['token'] ?? $resCreate['Response']['token'] ?? null;

if ($token) {
    $resStatus = Services::tokenStatus(["token" => $token, "user_id" => $userId]);
    var_dump($resStatus);
} else {
    echo "No se obtuvo token. Revisa credenciales y entorno.";
}

use SoftanConnect\Services;

// Token: crear
$resCreate = Services::requestToken(["user_id" => 12345]);

// Token: estado
$resStatus = Services::tokenStatus(["token" => "<TOKEN>", "user_id" => 12345]);

// OTP: crear
$resOtp = Services::requestOtp(["user_id" => 12345]);

// OTP: validar
$resVal = Services::validateOtp(["otp_code" => 123456, "user_id" => 12345]);

// Validar credenciales del desarrollador
$resCreds = Services::validateCredentials();

Services::requestToken($data, null, false);
Services::tokenStatus($data, null, false);
Services::requestOtp($data, null, false);
Services::validateOtp($data, null, false);
bash
composer 
bash
php vendor/bin/connect-setup.php
bash
composer 
bash
php vendor/bin/connect-setup.php
bash
php vendor/bin/connect-setup.php
bash
php vendor/bin/connect-setup.php \
  --email="[email protected]" \
  --api-key="<X-API-KEY>" \
  --connect-info="<X-Connect-Info>" \
  --app-id="SOM-XXXX" \
  --env=stg \
  --verify-tls=true
bash
php vendor/bin/connect-add-env.php
bash
php vendor/bin/connect-switch-env.php