PHP code example of betsolutions / casino-sdk

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

    

betsolutions / casino-sdk example snippets


$merchantAuthInfo = new MerchantAuthInfo(1843, 'https://api-staging.betsolutions.com', '[your private key]');

$walletService = new WalletService($merchantAuthInfo);

try {

    $privateToken = "[privateToken]";
    $playerId = "[player's id in merchant's system]";
    $currency = "EUR";
    
    $result = $walletService->getBalance(new GetBalanceRequest($privateToken, $playerId, $currency));

    if(200 == $result->statusCode)
    {
        $balance = $result->data->balance;
    }
} catch (CantConnectToServerException $ex) {
    echo $ex->getMessage();
    echo $ex->getHttpStatusCode();
} catch (JsonMappingException $e) {
    echo $e->getMessage();
}