PHP code example of spacecode.pl / spaceis-php-sdk

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

    

spacecode.pl / spaceis-php-sdk example snippets




use SpaceCode\SpaceIs\SpaceIs;

Url (optional)');

$spaceis->user->me();

$spaceis->server->getAll();
$spaceis->server->getSpecific('id/slug');
$spaceis->server->getCommands('id', 'serverToken');
$spaceis->server->getLatestBuys('id/slug', '(int) limit, default: 10');
$spaceis->server->getRichest('id/slug', '(int) limit, default: 10');

$spaceis->discountCode->get('code');

$spaceis->voucher->use('nick', 'code'); //throws VoucherNotFoundException & VoucherUsedException

$spaceis->subpage->get('slug');

$spaceis->variant->get('serverId/slug', 'productId');

$spaceis->transaction->init('serverId/slug', 'productId', 'variantId', 'nick', 'method', 'email', '(nullable) additional', '(nullable) discountCodeId');
$spaceis->transaction->info('transactionId', '(bool) extended, default: false');