Closed acegilz closed 8 years ago
Hi, It will be available soon!
While you don't have the helper completed, you can update the README with this that will surelly be helpfull and save some hours to some people like me:
public function placebetfair($marketId, $side, $selectionId, $size, $price)
{
$betfair = BetfairFactory::createBetfair('appkey', 'user', 'pass');
$params = Param::create();
$params->marketId = $marketId;
$params->instructions = [['selectionId' => $selectionId, 'side' => $side, 'orderType' => 'LIMIT', 'limitOrder' => ['size' => $size, 'price' => $price, 'persistenceType' =>'LAPSE']]];
$params->customerRef = 'fdsdf';
$placeOrders = $betfair->api($params, 'placeOrders');
}
Hey @acegilz, why not make a PR? Just rename placebetfair to placeOrder or placeBetfair in camelCase. If you want edit the readme, so you will became a contributor as well
Hi @acegilz, I'm trying to do exactly the same thing here - place an order into the market - and getting the same error you were in this thread: "Undefined index: result in ...ArrayRpcAdapter.php on line 17". Did you work out what was causing it? I tried using the code above (with the exception that I passed in the $betfair object as an argument) but am still getting the error with no bets being executed. Any help much appreciated!
Hey @ozer85 , I think that this PR can be related on this error: https://github.com/danieledangeli/betfair-php/pull/19 I'm happy to merge it in right now
If you guys are using a different version, probably you can your your own adapter to understand what is going on. If you decide to use the master version, now with that PR a Betfair error will be returned. When I'll have more time I'd like to raise proper exceptions!
Thanks @danieledangeli, that makes sense. And thanks for the awesome library too.
What is the simpler way to place and remove bets on betfair via api?