定制 yaro/gamstop 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yaro/gamstop

Composer 安装命令:

composer require yaro/gamstop

包简介

GAMSTOP package

README 文档

README

Package for Gamstop API for checking user's self-exclusion for online gambling.

Installation

You can install the package through Composer.

composer require yaro/gamstop

Usage

Laravel:

Just put in your services config file

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

For Laravel <5.5 add in your app config

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

And use like:

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

or implement GamstopCheckableInterface interface in your model to pass the model.

$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

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:

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

License

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

统计信息

  • 总下载量: 1.33k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固