Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
printBetResult(placeBet($appKey, $sessionToken, $marketId, $selectionId));

function placeBet($appKey, $sessionToken, $marketId, $selectionId)
{

    $params = '{"marketId":"' . $marketId . '",
                "instructions":
                     [{"selectionId":"' . $selectionId . '",
                       "handicap":"0",
                       "side":"BACK",
                       "orderType":
                       "LIMIT",
                       "limitOrder":{"size":"1",
                                    "price":"1000",
                                    "persistenceType":"LAPSE"}
                       }], "customerRef":"fsdf"}';

    $jsonResponse = sportsApingRequest($appKey, $sessionToken, 'placeOrders', $params);

    return $jsonResponse;

}

function printBetResult($betResult)
{
    echo "Status: " . $betResult->status;

    if ($betResult->status == 'FAILURE') {
        echo "\nErrorCode: " . $betResult->errorCode;
        echo "\n\nInstruction Status: " . $betResult->instructionReports[0]->status;
        echo "\nInstruction ErrorCode: " . $betResult->instructionReports[0]->errorCode;
    } else
        echo "Warning!!! Bet placement succeeded !!!";
}

Table of Contents
indent10px