koxder / unibet-api-client
Bundle to consume unibet API.
Installs: 52
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Type:package
Requires
- php: >=5.4
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: 5.2.*
This package is not auto-updated.
Last update: 2024-10-13 05:23:55 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