1. Go to this page and download the library: Download preverus/preverus-php 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/ */
preverus / preverus-php example snippets
use Preverus\Client;
$client = new Client($_ENV['PREVERUS_SERVER_KEY']);
$decision = $client->decisions()->evaluate([
'event_type' => 'signup',
'user_id' => 'acct_42',
'ip' => $_SERVER['REMOTE_ADDR'] ?? null,
'risk_session_token' => $_POST['preverus_risk_session_token'] ?? null,
'fingerprint' => $_POST['preverus_fingerprint'] ?? null,
'metadata' => [
'email' => $_POST['email'] ?? null,
'browser_session_event_id' => $_POST['preverus_browser_session_event_id'] ?? null,
],
], visitorId: $_POST['preverus_visitor_id'] ?? null);
if ($decision->isBlock()) {
http_response_code(403);
exit('Unable to create account.');
}
if ($decision->isReview()) {
// Trigger step-up auth, hold the action, or route to manual review.
}
// Continue signup, login, checkout, withdrawal, or payout.