PHP code example of omnifraud / signifyd

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

    

omnifraud / signifyd example snippets


$service = new KountService([
    'apiKey' => null, // Signifyd API key
    'caseUrl' => 'https://app.signifyd.com/cases/%d', // Url where cases are visible
    //... 
]);


$request = new \Omnifraud\Request\Request();

// Set request informations
$request->getPayment()->setBin('1234');
// Etc... Anything provided in the request is sent to Signifyd, except the billing address phone number


// Send the request

$service = new \Omnifraud\Signifyd\SignifydService($serviceConfig);

$response = $service->validateRequest($request);

// Should always be true for a first request
if ($response->isPending()) {
    // Queue job for later update
}


$service = new \Omnifraud\Signifyd\SignifydService($serviceConfig);

$request = new \Omnifraud\Request\Request();
$request->setUid($requestUid);

$response = $service->updateRequest($request);

// Use for updating
$requestUid = $response->getRequestUid();

if ($response->isPending()) {
    // Retry later
    return;
}

$score = $response->getScore(); // Signifyd score divided by 10, 100 is best, 0 is worst
$guaranteed = $response->isGuaranteed(); // If covered by Signifyd guarantee


$service = new \Omnifraud\Signifyd\SignifydService($serviceConfig);

$request = new \Omnifraud\Request\Request();
$request->setUid($requestUid);

try {
    $service->cancelRequest($request);
} catch(\Omnifraud\Request\RequestException $e) {
    // Something went wrong
}

// Retrieve the session ID with some method, it can come from server side cookies/session also
$request->setSession($_COOKIE['sessionId']);

$service = new \Omnifraud\Kount\KountService($serviceConfig);
$url = $service->getRequestExternalLink($requestUid);