1. Go to this page and download the library: Download moonito/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/ */
moonito / php-sdk example snippets
use Moonito\Client;
$moonito = Client::fromArray([
'public_key' => getenv('MOONITO_PUBLIC_KEY'),
'secret_key' => getenv('MOONITO_SECRET_KEY'),
]);
$moonito->protect(); // blocks and redirects if needed, otherwise returns
$decision = $moonito->evaluate();
if ($decision->isBlock()) {
$moonito->enforce($decision); // does not return
}
if ($decision->score() > 70) {
$order->flagForReview($decision->reasons());
}