PHP code example of patryqhyper / spaceis-php-sdk

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

    

patryqhyper / spaceis-php-sdk example snippets




use PatryQHyper\SpaceIs\SpaceIs;

$spaceIs = new SpaceIs('apiKey', 'apiUrl (optional)');

# Servers
$spaceIs->getServers();
$spaceIs->getServer('serverId/serverSlug');
$spaceIs->getCommands('serverId', 'serverToken');
$spaceIs->getLatestBuys('serverId/serverSlug', '(int) limit (optional, default:10)');
$spaceIs->getRichest('serverId/serverSlug', '(int) limit (optional, default:10)');

# Variants
$spaceIs->getVariants('serverId/serverSlug', 'productId');

# Payments
$spaceIs->initPayment('serverId/serverSlug', 'productId', 'variantId', 'nick', 'method', 'email (