PHP code example of boatrace-sakura / purchaser

1. Go to this page and download the library: Download boatrace-sakura/purchaser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

boatrace-sakura / purchaser example snippets




oatrace\Sakura\Purchaser;

// テレボートに5000円を入金して大村12Rの3連単(1-23-234)を購入する場合は以下の通りです。
// なお、加入者番号、暗証番号、認証用パスワード、投票用パスワードの部分は
// 自分のテレボート会員情報に書き換えてください。
// 場コード: 桐生 => 1, 戸田 => 2, 江戸川 => 3, ..., 唐津 => 23, 大村 => 24
// 勝式コード: 単勝 => 1, 複勝 => 2, 2連単 => 3, 2連複 => 4, 拡連複 => 5, 3連単 => 6, 3連複 => 7
Purchaser::setDepositAmount(5000)             // 入金指示金額
    ->setSubscriberNumber('xxxxxxxx')         // 加入者番号
    ->setPersonalIdentificationNumber('xxxx') // 暗証番号
    ->setAuthenticationPassword('xxxxxx')     // 認証用パスワード
    ->setPurchasePassword('xxxxxx')           // 投票用パスワード
    ->purchase(24, 12, 6, [                   // 場コード, レース番号, 勝式コード
        123 => 1500,                          // 組番 => 購入金額
        124 => 1500,                          // 組番 => 購入金額
        132 => 1000,                          // 組番 => 購入金額
        134 => 1000,                          // 組番 => 購入金額
    ]);
bash
code example.php
bash
php example.php