spinshield/spinclient 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

spinshield/spinclient

最新稳定版本:1.0.8

Composer 安装命令:

composer require spinshield/spinclient

包简介

无描述信息

README 文档

README

To assist easier integration for operators using PHP. Works on any PHP > 5, requires GuzzleHttp.

You can use this package in your existing PHP based projects. This includes any PHP based framework, like Laravel, Lumen, Yiii and so on.

Install

Run in your PHP project: composer require spinshield/spinclient

Function Overview

API Client Functions

// e.g. getGame("player123", "playerPass123", "platipus/egyptiangold", "USD", "https://casino.com", "https://casino.com/deposit", 0, "en"); getGame($username, $userpassword, $game_id, $currency, $homeurl, $cashierurl, $play_for_fun, $lang); // e.g. getGameDemo("platipus/egyptiangold", "USD", "https://casino.com", "https://casino.com/deposit", "en"); getGameDemo($game_id, $currency, $homeurl, $cashierurl, $lang); // e.g. getGameList("USD", 1); getGameList($currency, $list_type); // e.g. createPlayer("player123", "playerPass123", "Malone", "USD"); createPlayer($username, $userpassword, $usernickname, $currency); // e.g. addFreeRounds("player123", "playerPass123", "platipus/egyptiangold", "USD", 10, 0); addFreeRounds($username, $userpassword, $game_id, $currency, $freespins, $betlevel); // e.g. getFreeRounds("player123", "playerPass123", "USD"); getFreeRounds($username, $userpassword, $currency); // e.g. deleteFreeRounds("platipus/egyptiangold", "player123", "playerPass123", "USD"); deleteFreeRounds($gameid, $username, $userpassword, $currency); // e.g. deleteFreeRounds("player123", "playerPass123", "USD"); deleteAllFreeRounds($username, $userpassword, $currency);

Helpers Functions

This package also includes helpers to assist you in for example returning responses on callbacks. See examples below how to implement.

Helper functions to assist you on callbacks:

// validate the callback request coming from our gameserver, take 'key', 'timestamp' from each callback and salt from your apikey configuration in backoffice isValidKey($key, $timestamp, $salt); // construct balance response in JSON format balanceResponse($intBalance); // construct insufficient balance in JSON format insufficientBalance($intBalance); //construct generic error reponse (when you have error processing callback) in JSON format processingError(); 

Generic Helper functions:

// check for error code on api responses responseHasError($apiResponse); // morphs json object to associative array morphJsonToArray($input); // because our API communicates using int value in cents, this can assist you to convert for example ($) 2.00 to 200 securely floatToIntHelper($floatValue); // converts int back to float (2 decimals) intToFloatHelper($intValue); 

Examples

PHP Usage Example

<?php use spinshield/spinclient; require __DIR__.'/vendor/autoload.php'; $client = new spinclient\ApiClient(array( "endpoint" => "https://secretendpoint.com", "api_login" => "12345", "api_password" => "12345", )); var_export($client->getGameList("USD", 1));

Laravel Usage Example

routes/web.php:

Route::get('/spinshield_example/gamelist', [\App\Http\Controllers\SpinController::class, 'gamelist']); Route::get('/spinshield_example/gameflow', [\App\Http\Controllers\SpinController::class, 'gameflow']);

app/Http/Controllers/SpinController.php

<?php namespace App\Http\Controllers; use spinshield\spinclient; class SpinController { function __construct() { $this->client = new spinclient\ApiClient(array( "endpoint" => "https://secretendpoint.net", "api_login" => "12345", "api_password" => "12345", )); $this->helpers = new spinclient\Helpers(); } public function gamelist() { return $this->client->getGameList("USD", 1); } public function gameflow() { $createPlayer = $this->client->createPlayer("playerId1337", "playerPassword", "Tiernan", "USD"); if($this->helpers->responseHasError($createPlayer)) { return $createPlayer; } else { $getGame = $this->client->getGame("playerId1337", "playerPassword", "platipus/egyptiangold", "USD", "https://casino.com", "https://casino.com/deposit", 0, "en"); return $getGame; } } }

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固