PHP code example of uspdev / senhaunica

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

    

uspdev / senhaunica example snippets



session_start();

use Uspdev\Senhaunica\Senhaunica;

$clientCredentials = [
    'identifier' => 'identificacao',
    'secret' => 'chave-secreta',
    'callback_id' => 0,
];

Senhaunica::login($clientCredentials);

header('Location:../');
exit;


session_start();

use Uspdev\Senhaunica\Senhaunica;

putenv('SENHAUNICA_KEY=');
putenv('SENHAUNICA_SECRET=');
putenv('SENHAUNICA_CALLBACK_ID=');

Senhaunica::login();

header('Location:../');
exit;

$campo = 'tipoVinculo';
$valores = ['SERVIDOR','OUTRO_VINCULO', '...'];
$vinculo = Uspdev\Senhaunica\Senhaunica::obterVinculo($campo, $valores);