GithubHelp home page GithubHelp logo

betfair-php's People

Contributors

daaahhnuh avatar danieledangeli avatar giuliogatto avatar simoheinonen avatar violuke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

betfair-php's Issues

Get markets ids

Hi, how do i get the markets ids from an event? And after i have the market id, how can i get the odds of that market?

Issue after install composer

Hello, i downloaded source code keeping compose.json details and then i installed composer in xampp server, it created vendor and other folders with files. I checked in browser and there are two issues.

Deprecated: The ability to pass file names to the Symfony\Component\Yaml\Yaml::parse method is deprecated since version 2.2 and will be removed in 3.0. Pass the YAML contents of the file instead. in C:\xampp\htdocs\betfair\vendor\symfony\yaml\Symfony\Component\Yaml\Yaml.php on line 58

Fatal error: Unsupported operand types in C:\xampp\htdocs\betfair\vendor\guzzlehttp\guzzle-services\src\GuzzleClient.php on line 72

I fixed first one installing "symfony/yaml": "2.6.5" but the second one i could not figure out.

Thank you for your help.

SSL certificate problem

Hello and tahnk you for this project.

I installed project with composer with follow composer.json
{
"name": "Alex",
"description": "My app",
"require": {
"php": ">=5.4",
"erlangb/betfair": "0.2.*",
"symfony/yaml": "~2.6",
"symfony/finder": "~2.6"
},
"autoload": {
"psr-0" : { "betfair" : "src" }
}
}

Now, i'm reciving this issue. I tried to install original json file but i still gets operator += issue
This is issue i'm geting. Thank you

Fatal error: Uncaught exception 'GuzzleHttp\Ring\Exception\RingException' with message 'cURL error 60: SSL certificate problem: unable to get local issuer certificate' in C:\xampp\htdocs\betfair\vendor\guzzlehttp\ringphp\src\Client\CurlFactory.php:126 Stack trace: #0 C:\xampp\htdocs\betfair\vendor\guzzlehttp\ringphp\src\Client\CurlFactory.php(90): GuzzleHttp\Ring\Client\CurlFactory::createErrorResponse(Object(GuzzleHttp\Ring\Client\CurlHandler), Array, Array) #1 C:\xampp\htdocs\betfair\vendor\guzzlehttp\ringphp\src\Client\CurlHandler.php(78): GuzzleHttp\Ring\Client\CurlFactory::createResponse(Object(GuzzleHttp\Ring\Client\CurlHandler), Array, Array, Array, Resource id #152) #2 C:\xampp\htdocs\betfair\vendor\guzzlehttp\ringphp\src\Client\Middleware.php(54): GuzzleHttp\Ring\Client\CurlHandler->__invoke(Array) #3 C:\xampp\htdocs\betfair\vendor\guzzlehttp\ringphp\src\Client\Middleware.php(30): GuzzleHttp\Ring\Client\Middleware::GuzzleHttp\Ring\Client{closure}(Array) #4 C:\xampp\htdocs\betfair\vendor\guzzlehttp\guzzle\src\Req in C:\xampp\htdocs\betfair\vendor\guzzlehttp\command\src\AbstractClient.php on line 171

Fatal error: Uncaught Error: Class 'Betfair\Credential' not found in E:\xampp\htdocs\dashboard\angel_game\main_page.php:15 Stack trace: #0 {main} thrown in E:\xampp\htdocs\dashboard\angel_game\main_page.php on line 15

I have uploaded SSL certificate in Betfair website on and I don't know why this error occurs.

require 'vendor/autoload.php';
use Betfair\Credential;
use Betfair\Dependency\BetfairContainer;
use Betfair\Betfair;
use Betfair\Client\BetfairClient;
use Betfair\Client\JsonRpcClient;
use Betfair\Adapter\ArrayAdapter;

$credential = new Credential("s3NsobeDubtATjhy", $username,$password);
$container = new BetfairContainer();
$betfairClient = new BetfairClient($credential, new JsonRpcClient());

$betfair = new Betfair($betfairClient, $container, new ArrayAdapter());

Problem with setMarketProjection

Hello there:

Even when using original code I get this error when trying to get some data:

Catchable fatal error: Argument 1 passed to Betfair\Model\Param::setMarketProjection() must be an instance of Betfair\Model\MarketProjection, null given

Can someone help me? Tried to do:

->setMarketProjection( new MarketProjection\Betfair\Model\MarketProjection::COMPETITION )

Without any luck

library needs updating to reflect new guzzle

Package guzzlehttp/ringphp is abandoned, you should avoid using it. No replacement was suggested.
Package guzzlehttp/streams is abandoned, you should avoid using it. No replacement was suggested.

Proxy Support

My server is on a blocked location and I need to use a VPN to change the entire server network just to access betfair, it would be cool to implement a proxy on future versions.

Get the score

Hi. Is there a method to get the score of a in play event ?

For example the live score of soccer game?

Thank you

Example of place bet

Hi!
Can you give me example of place bets?
I have tried , but without success.
thanks

Locale does not work

I printed events result like this but time zone is for Europe/London.

[0] => Array
(
[event] => Array
(
[id] => 27417270
[name] => Carpi v Brescia
[countryCode] => IT
[timezone] => Europe/London
[openDate] => 2015-04-18T13:00:00.000Z
)

        [marketCount] => 8
    )

I checked API docummentation in Betfair website and i found i can change with LOCALE param.
In your function getAllEventFilteredByEventTypeIds i added ->setLocale("ES"); for a spanish timezone but it still shows same result Europe/London.

public function getAllEventFilteredByEventTypeIds(array $eventTypeIds)
{
$marketFilter = $this->createMarketFilter();
$marketFilter->setEventTypeIds($eventTypeIds);
$param = $this->createParam($marketFilter)
->setLocale("ES");

    return $this->adapter->adaptResponse(
        $this->apiNgRequest(self::API_METHOD_NAME, $param)
    );
}

Do you know how can i change language, timezone and country?
I want deploy it in Colombia.
Thank you for your help, API and you time.
I hope contribute soon as possible when i get ideas after play with it.
Alex

Issue while installing

E:\xampp\htdocs\practice\betfair>curl -sS https://getcomposer.org/installer | php
PHP Warning: Module 'mongo' already loaded in Unknown on line 0

Warning: Module 'mongo' already loaded in Unknown on line 0
PHP Parse error: syntax error, unexpected ''Disabling it when using Compo' (T_ENCAPSED_AND_WHITESPACE), expecting ')' in - on line 358

Parse error: syntax error, unexpected ''Disabling it when using Compo' (T_ENCAPSED_AND_WHITESPACE), expecting ')' in - on line 358
curl: (23) Failed writing body (274 != 16384)

E:\xampp\htdocs\practice\betfair>

E:\xampp\htdocs\practice\betfair>php composer.phar require erlangb/betfair-php:dev-master
PHP Warning: Module 'mongo' already loaded in Unknown on line 0

Warning: Module 'mongo' already loaded in Unknown on line 0
Could not open input file: composer.phar

Error DSC-0018 with getMarketCatalogueFilteredBy()

MarketCatalogue::getMarketCatalogueFilteredBy()
gives an error from BetFair:

DSC-0018 - MandatoryNotDefined

maxResults in $param remains null because of this condition:

if ($this->maxResults === null) {
    $param->setMaxResults(self::MAX_RESULT);
}

Could not find a matching version of package erlangb/betfair-php

Hi, when I run the command "php composer.phar require erlangb/betfair-php:dev-master" I receive this error: [InvalidArgumentException]
Could not find a matching version of package erlangb/betfair-php. Check the
package spelling, your version constraint and that the package is availabl
e in a stability which matches your minimum-stability (stable).

Why?

Filters are not working

I have been trying out this library and i can not seem to get the filters or any parameters to work properly. Meaning, if i for example add a market filter, i still get results unaffected by the filter - all of them. Maybe i am doing something wrong, but i have spent quite some time trying this and that and it is just not working..

Small configuration:

$MARKETS = ["MATCH_ODDS", "CORRECT_SCORE", "HALF_TIME", "HALF_TIME_SCORE", "ASIAN_HANDICAP", "TOTAL_GOALS", "FIRST_HALF_GOALS_05", "FIRST_HALF_GOALS_15", "FIRST_HALF_GOALS_25", "OVER_UNDER_05", "OVER_UNDER_15", "OVER_UNDER_25", "OVER_UNDER_35", "OVER_UNDER_45", "OVER_UNDER_55"];
$COMPETITIONS = [7317506, 164952, 15, 3126267, 888275, 3085749, 892425, 4848838, 862638, 21, 1987477, 158146, 63, 840808, 1242586, 119, 121, 123, 125, 127, 2901699, 862545, 873203, 57, 111, 13051, 6294086, 3992967, 1985077, 219, 6301, 943450, 907589, 3126286, 83, 1587980, 1661891, 887178, 2609677, 827754, 836645, 5449376, 403085, 876442, 9513, 863810, 862579, 3006957, 880458, 101, 891179, 8141281, 920223, 4608865, 872215, 1888360, 1658999, 139, 3089001, 908196, 7897688, 3061353, 895129, 5618298, 857992, 844197, 65, 853948, 852459, 4556663, 4556656, 3792498, 3221481, 4040072, 17, 1842928, 311575, 4556576, 905441, 3127737, 879221, 827078, 1327393, 920858, 868392, 872270, 2938065, 115, 6103298, 175680, 7946082, 4732508, 1065530, 4517491, 1478090, 97807, 4431442, 821269, 2356065, 97, 32246, 103, 113, 194215, 843454, 7942109, 309948, 3729355, 13, 803690, 6566654, 887158, 7616742, 3242305, 839575, 842258, 4905, 4802204, 5448752, 1079277, 318343, 984404, 7197874, 3037492, 856134, 2079376, 59, 886734, 4802285, 1062024, 8053761, 7138694, 61351, 97855];
$IN_PLAY_ONLY = true;
$EVENT_TYPES = [1];

Queries:

(create betfair object) 
....
$marketCatalogue = $betfair->getBetfairMarketCatalogue();
$marketFilter = MarketFilter::create()
    ->setCompetitionIds($COMPETITIONS)
    ->setMarketBettingTypes($MARKETS)
    ->setInPlayOnly($IN_PLAY_ONLY);
return $marketCatalogue
    ->withMarketProjections(array(MarketProjection::EVENT))
    ->withMarketFilter($marketFilter)
    ->withMaxResult(1000)
    ->listMarketCatalogue($EVENT_TYPES);

Result:

This returns 99 results without event info (market projection), not in play events, not the specified competitions and all of the markets

....
[95] => Array
    (
        [marketId] => 1.118280148
        [marketName] => 2015/16 Winner
        [totalMatched] => 5419764.80794
    )

[96] => Array
    (
        [marketId] => 1.118280287
        [marketName] => Top 5 Finish 2015/16
        [totalMatched] => 19885.955712
    )

[97] => Array
    (
        [marketId] => 1.118280285
        [marketName] => Team to Score Most Goals 2015/16
        [totalMatched] => 11338.361174
    )

[98] => Array
    (
        [marketId] => 1.118280283
        [marketName] => Straight Tricast 2015/16
        [totalMatched] => 9909.808496
    )

[99] => Array
    (
        [marketId] => 1.118880359
        [marketName] => Top London Club 2015/16 - Please Read Rules
        [totalMatched] => 3020.681958
    )

Place bets

What is the simpler way to place and remove bets on betfair via api?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.