2017 © Pedro Peláez
 

library gamstop

GAMSTOP package

image

yaro/gamstop

GAMSTOP package

  • Wednesday, May 23, 2018
  • by Cherry Pie
  • Repository
  • 1 Watchers
  • 0 Stars
  • 891 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 447 % Grown

The README.md

Gamstop

Package for Gamstop API for checking user's self-exclusion for online gambling., (*1)

Installation

You can install the package through Composer., (*2)

composer require yaro/gamstop

Usage

Laravel:

Just put in your services config file, (*3)

'gamstop' => [
    'key' => env('GAMSTOP_API_KEY'),
],

For Laravel <5.5 add in your app config, (*4)

'providers' => [
    Yaro\Gamstop\ServiceProvider::class,
    //...
];
'aliases' => [
    'Gamstop' => Yaro\Gamstop\Facade::class,
    //...
];

And use like:, (*5)

Gamstop::checkParams($firstName, $lastName, $dateOfBirth, $email, $postcode, $xTraceId);

or implement GamstopCheckableInterface interface in your model to pass the model., (*6)

$user = User::first();
$isUserAllowedToPlay = Gamstop::check($user)->isAllowed();

Other:

$gamstop = new \Yaro\Gamstop\Gamstop\Api($apiKey);
$response = $gamstop->checkParams($firstName, $lastName, $dateOfBirth, $email, $postcode, $xTraceId);
var_dump($response->isBlocked());

You should catch all exceptions, (*7)

try {
    $response = Gamstop::check($user);
    // ...
} catch (\Yaro\Gamstop\ExceptionsMissingParametersException $e) {
    // if missing parameters
} catch (\Yaro\Gamstop\ExceptionsApiKeyInvalidException $e) {
    // if API key invalid or IP address not in range
} catch (\Yaro\Gamstop\ExceptionsNonPostCallException $e) {
    // for non-POST calls
} catch (\Yaro\Gamstop\ExceptionsRateLimitedException $e) {
    // if rate limited
} catch (\Yaro\Gamstop\NetworkingErrorException $e) {
    // in case of networking error (connection timeout, DNS errors, etc.)
}

catching this exception will catch any exception that can be thrown:, (*8)

try {
    $response = Gamstop::check($user);
    // ...
} catch (\Yaro\Gamstop\GamstopBaseException $e) {

}

License

The MIT License (MIT). Please see LICENSE for more information., (*9)

The Versions

23/05 2018

dev-master

9999999-dev

GAMSTOP package

  Sources   Download

MIT

The Requires

 

laravel gambling gamstop

25/04 2018

0.1.0

0.1.0.0

GAMSTOP package

  Sources   Download

MIT

The Requires

 

laravel gambling gamstop