<?php use IjorTengab\IBank\IBank; use IjorTengab\IBank\Log; // 1. Tentukan lokasi file autoload.php yang dibuat oleh Composer. $autoload[] = __DIR__ . '/../vendor/autoload.php'; $autoload[] = __DIR__ . '/../../../autoload.php'; $autoload[] = '/home/ijortengab/project/github/ibank/vendor/autoload.php'; array_map(function ($f) { if (file_exists($f)) { require $f; } }, $autoload); // 2. Tentukan informasi yang dibutuhkan, penjelasan lengkap lihat README.md. $information['username'] = (require '/home/ijortengab/bni-username.php'); $information['password'] = (require '/home/ijortengab/bni-password.php'); $information['account'] = (require '/home/ijortengab/bni-account.php'); $information['range'] = null; // Optional. $information['sort'] = 'asc'; // Optional. $information['cwd'] = '/home/ijortengab/ibank'; // Optional. // 3 Save dan jalankan file script ini di browser atau console. echo PHP_SAPI == 'cli' ? '' : '<pre>'; // 4. Execute. $result = IBank::BNI('get_transaction', $information); echo '$result: ', print_r($result, true), PHP_EOL; // 5. Disarankan untuk mengecek log (error/notice/debug). $log = Log::get(); echo '$log: ', print_r($log, true), PHP_EOL;
<?php use IjorTengab\IBank\IBank; use IjorTengab\IBank\Log; // 1. Tentukan lokasi file autoload.php yang dibuat oleh Composer. $autoload[] = __DIR__ . '/../vendor/autoload.php'; $autoload[] = __DIR__ . '/../../../autoload.php'; $autoload[] = '/home/ijortengab/project/github/ibank/vendor/autoload.php'; array_map(function ($f) { if (file_exists($f)) { require $f; } }, $autoload); // 2. Tentukan informasi yang dibutuhkan, penjelasan lengkap lihat README.md. $information['cwd'] = '/home/ijortengab/ibank'; // Optional. // 3 Save dan jalankan file script ini di browser atau console. echo PHP_SAPI == 'cli' ? '' : '<pre>'; // 4. Execute. $result = IBank::BCA('logout', $information); echo '$result: ', print_r($result, true), PHP_EOL; // 5. Disarankan untuk mengecek log (error/notice/debug). $log = Log::get(); echo '$log: ', print_r($log, true), PHP_EOL;
<?php use IjorTengab\IBank\IBank; use IjorTengab\IBank\Log; // 1. Tentukan lokasi file autoload.php yang dibuat oleh Composer. $autoload[] = __DIR__ . '/../vendor/autoload.php'; $autoload[] = __DIR__ . '/../../../autoload.php'; $autoload[] = '/home/ijortengab/project/github/ibank/vendor/autoload.php'; array_map(function ($f) { if (file_exists($f)) { require $f; } }, $autoload); // 2. Tentukan informasi yang dibutuhkan, penjelasan lengkap lihat README.md. $information['username'] = (require '/home/ijortengab/bni-username.php'); $information['password'] = (require '/home/ijortengab/bni-password.php'); $information['account'] = (require '/home/ijortengab/bni-account.php'); $information['cwd'] = '/home/ijortengab/ibank'; // Optional. // 3 Save dan jalankan file script ini di browser atau console. echo PHP_SAPI == 'cli' ? '' : '<pre>'; // 4. Execute. $result = IBank::BNI('get_balance', $information); echo '$result: ', print_r($result, true), PHP_EOL; // 5. Disarankan untuk mengecek log (error/notice/debug). $log = Log::get(); echo '$log: ', print_r($log, true), PHP_EOL;
protected function bcaFilterTransactionTable($tables) { $ref = IBank::reference('table_header_account_statement'); $ref = array_flip($ref); $transactions = []; while (!empty($tables)) { $transaction = []; $table = array_shift($tables); if (count($table) == 6) { list($tgl, $keterangan, $cab, $mutasi_1, $mutasi_2, $saldo) = $table; $transaction['date'] = $this->bcaConvertDateTransaction($tgl); $keterangan = implode('', $keterangan); $keterangan = preg_replace('/<[^>]+>/', ' ', $keterangan); $keterangan = preg_replace('/\\s\\s+/', ' ', $keterangan); $keterangan = trim($keterangan); $transaction['description'] = $keterangan; $transaction['bca_branch'] = $cab; $transaction['bca_date'] = $tgl; $transaction['amount'] = $mutasi_1; $transaction['type'] = $mutasi_2; $transaction['balance'] = $saldo; $transaction['no'] = null; $transaction['id'] = null; } $transactions[] = array_merge($ref, $transaction); } return $transactions; }
/** * Mendapatkan array transaksi dengan format yang sudah rapih. */ protected function bniFilterTransactionTable($tables) { $ref = IBank::reference('table_header_account_statement'); $ref = array_flip($ref); $language = $this->configuration('language'); $language = null === $language ? 'id' : $language; $transactions = []; while (!empty($tables)) { $table = array_shift($tables); if (isset($table[0]) && isset($table[1])) { $info = $language == 'id' ? $this->bniTranslate($table[0]) : $table[0]; $value = $table[1]; switch ($info) { case 'Transaction Date': $transaction = ['no' => null, 'id' => null]; $transaction['date'] = $value; break; case 'Transaction Remarks': $transaction['detail'] = $value; break; case 'Amount type': $transaction['type'] = $value; break; case 'Amount': $transaction['amount'] = $value; break; case 'Account Balance': $transaction['balance'] = $value; $transactions[] = array_merge($ref, $transaction); break; } } } return $transactions; }