forked from h4kuna/fio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFioTest.php
40 lines (31 loc) · 1.22 KB
/
FioTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php declare(strict_types=1);
require __DIR__ . '/../bootstrap.php';
$ini = __DIR__ . '/account.ini';
if (!is_file($ini)) {
throw new \h4kuna\Fio\Exceptions\InvalidArgument('File not found: ' . $ini);
}
$accounts = parse_ini_file($ini, true);
if ($accounts === false) {
throw new \h4kuna\Fio\Exceptions\InvalidState('You have bad format for ini file. Let\'s see account.example.ini.');
}
$fioFactory = new \h4kuna\Fio\Utils\FioFactory($accounts);
$fioRead = $fioFactory->createFioRead();
foreach ($fioRead->movements('-1 month') as $transaction) {
/* @var $transaction \h4kuna\Fio\Response\Read\Transaction */
var_dump($transaction->moveId);
}
// sleep
foreach ($fioRead->movements('-1 month') as $transaction) {
/* @var $transaction \h4kuna\Fio\Response\Read\Transaction */
\Tester\Assert::true(is_int($transaction->moveId));
}
// blocation is per token
$fioPay = $fioFactory->createFioPay();
$log = $fioPay->enableLog();
//$national = $fioPay->createNational(100, '2600267402/2010');
//$response = $fioPay->send($national);
$euro = $fioPay->createEuro(100, 'EE957700771001355096/LHVBEE22XXX', 'Coinbase UK, Ltd.');
$response = $fioPay->send($euro);
dump($log->getFilename());
echo($log->getContent());
dumpe($response->status());