koxder / unibet-api-client
Bundle to consume unibet API.
v1.2
2018-07-19 12:58 UTC
Requires
- php: >=5.4
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: 5.2.*
This package is not auto-updated.
Last update: 2026-03-01 12:56:11 UTC
README
Bundle to handle the UNIBET API. More information here:
Configuration
You should send as argument these vars when you instance the client.
app_key [required] = app key of unibet. app_id [required] = app id of unibet. type_of_bet [optional] = [ 0 = Only request Match Bets, 1 = Get all bets for each match ] response [optional] = [ 'json' = Return data in JSON format. 'xml' = Return data in XML format. ]
Example
use UnibetApiClient\Client; use UnibetApiClient\NotFoundException; $client = new Client(["app_key" => "secret_app_key", "app_id" => "secret_api_key", "type_of_bet" => 1, "response" => 'json' ]); try{ $bets = $client->getBets('123456677'); print_r($bets); }catch (NotFoundException $e){ print("Resource not found"); }
Test Unit
docker build -t unibet . docker run -v $(pwd):/app --rm -it unibet vendor/bin/phpunit tests/UnibetClientTest.php
Using docker
docker run -v $(pwd):/app --rm -it composer/composer install