PHPackages                             slotsgateway/slotsgateway-php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. slotsgateway/slotsgateway-php-client

ActiveLibrary[API Development](/categories/api)

slotsgateway/slotsgateway-php-client
====================================

1.0.9(4mo ago)076MITPHPPHP &gt;=5.3.0

Since Oct 15Pushed 4mo agoCompare

[ Source](https://github.com/slotsgateway/slotsgateway-php-client)[ Packagist](https://packagist.org/packages/slotsgateway/slotsgateway-php-client)[ Docs](https://github.com/spinshield)[ RSS](/packages/slotsgateway-slotsgateway-php-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (10)Used By (0)

Slotsgateway PHP Client
=======================

[](#slotsgateway-php-client)

**Slotsgateway PHP Client** is a PHP library designed to simplify integration with the **Slotsgateway API**.

It supports **PHP 5.0+** and uses **GuzzleHTTP** for HTTP communication.
The client can be used in any PHP-based project or framework, including **Laravel**, **Lumen**, **Yii**, and similar frameworks.

---

Requirements
------------

[](#requirements)

- PHP **5.0 or higher**
- Composer
- GuzzleHTTP

---

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require slotsgateway/slotsgateway-php-client
```

---

API Client Overview
-------------------

[](#api-client-overview)

The `ApiClient` class provides direct wrappers for all Slotsgateway API methods.

### Available API Methods

[](#available-api-methods)

```
// 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
);
```

---

Helper Functions
----------------

[](#helper-functions)

The package includes a `Helpers` class to simplify callback handling and common data transformations.

### Callback Helpers

[](#callback-helpers)

```
// 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();
```

### General Utility Helpers

[](#general-utility-helpers)

```
// 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);
```

---

Usage Examples
--------------

[](#usage-examples)

### Basic PHP Example

[](#basic-php-example)

```
