PHP code example of stadar / sdk
1. Go to this page and download the library: Download stadar/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/ */
stadar / sdk example snippets
use Stadar\Sdk\Api\GamesApi;
use Stadar\Sdk\Extra\FromEnv;
$config = FromEnv::configuration(); // reads STADAR_API_KEY
$games = new GamesApi(null, $config);
$list = $games->listGames();
use Stadar\Sdk\Extra\Webhooks;
$body = file_get_contents('php://input');
if (!Webhooks::verify($body, $_SERVER['HTTP_X_STADAR_SIGNATURE'] ?? '', getenv('STADAR_WEBHOOK_SECRET') ?: '')) {
http_response_code(401);
exit;
}