PHP code example of slotsgateway / slotsgateway-php-client
1. Go to this page and download the library: Download slotsgateway/slotsgateway-php-client 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/ */
slotsgateway / slotsgateway-php-client example snippets
// Open a real-money game session
getGame(
$username,
$userpassword,
$game_id,
$currency,
$homeurl,
$cashierurl,
$play_for_fun,
$lang
);
// Open a demo (fun-play) game session
getGameDemo(
$game_id,
$currency,
$homeurl,
$cashierurl,
$lang
);
// Retrieve the game list
getGameList(
$currency,
$list_type
);
// Create or initialize a player
createPlayer(
$username,
$userpassword,
$usernickname,
$currency
);
// Add free spins to a player
addFreeRounds(
$username,
$userpassword,
$game_id,
$currency,
$freespins,
$betlevel
);
// Retrieve free spins history
getFreeRounds(
$username,
$userpassword,
$currency
);
// Delete free spins for a specific game
deleteFreeRounds(
$gameid,
$username,
$userpassword,
$currency
);
// Delete all free spins for a player
deleteAllFreeRounds(
$username,
$userpassword,
$currency
);
// Validate callback signature using key, timestamp, and your API salt key
isValidKey($key, $timestamp, $salt);
// Return a valid balance response (integer, cents)
balanceResponse($intBalance);
// Return an insufficient balance response
insufficientBalance($intBalance);
// Return a generic processing error response
processingError();
// Check if an API response contains an error
responseHasError($apiResponse);
// Convert a JSON object into an associative array
morphJsonToArray($input);
// Convert float balance (e.g. 2.00) to integer cents (200)
floatToIntHelper($floatValue);
// Convert integer cents back to float (2 decimals)
intToFloatHelper($intValue);