1. Go to this page and download the library: Download spinshield/spinclient 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/ */
// validate the callback request coming from our gameserver, take 'key', 'timestamp' from each callback and salt from your apikey configuration in backoffice
isValidKey($key, $timestamp, $salt);
// construct balance response in JSON format
balanceResponse($intBalance);
// construct insufficient balance in JSON format
insufficientBalance($intBalance);
//construct generic error reponse (when you have error processing callback) in JSON format
processingError();
// check for error code on api responses
responseHasError($apiResponse);
// morphs json object to associative array
morphJsonToArray($input);
// because our API communicates using int value in cents, this can assist you to convert for example ($) 2.00 to 200 securely
floatToIntHelper($floatValue);
// converts int back to float (2 decimals)
intToFloatHelper($intValue);