Skip to content

Commit 9fa4fa3

Browse files
committed
Examples updated
1 parent d117cdc commit 9fa4fa3

3 files changed

Lines changed: 112 additions & 14 deletions

File tree

Examples/accounts.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
require_once \dirname(__DIR__).'/vendor/autoload.php';
1919

20-
Shr::init(['CSAS_API_KEY', 'CSAS_ACCESS_TOKEN', 'CSAS_API_DEBUG', 'CSAS_SANDBOX_MODE'], \dirname(__DIR__).'/.env');
20+
Shr::init(['CSAS_API_KEY', 'CSAS_ACCESS_TOKEN', 'CSAS_SANDBOX_MODE'], \dirname(__DIR__).'/.env');
21+
22+
// Keep your tokens fresh using https://github.com/Spoje-NET/csas-authorize.git
2123

2224
$apiInstance = new \SpojeNET\CSas\Accounts\DefaultApi(new SpojeNET\CSas\ApiClient(
2325
[

Examples/balance.php

Lines changed: 94 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
require_once \dirname(__DIR__).'/vendor/autoload.php';
1919

20-
Shr::init(['CSAS_API_KEY', 'CSAS_ACCESS_TOKEN', 'CSAS_API_DEBUG', 'CSAS_SANDBOX_MODE'], \dirname(__DIR__).'/.env');
20+
Shr::init(['CSAS_API_KEY', 'CSAS_ACCESS_TOKEN', 'CSAS_SANDBOX_MODE'], \dirname(__DIR__).'/.env');
21+
22+
// Keep your tokens fresh using https://github.com/Spoje-NET/csas-authorize.git
2123

2224
$apiInstance = new \SpojeNET\CSas\Accounts\DefaultApi(new SpojeNET\CSas\ApiClient(
2325
[
@@ -29,8 +31,98 @@
2931
));
3032

3133
try {
32-
$result = $apiInstance->getAccountBalance(Shr::cfg('ACCOUNT'));
34+
$result = $apiInstance->getAccountBalance(Shr::cfg('CSAS_ACCOUNT_IBAN'));
3335
print_r($result);
3436
} catch (Exception $e) {
3537
echo 'Exception when calling DefaultApi->getAccountBalance: ', $e->getMessage(), \PHP_EOL;
3638
}
39+
40+
/*
41+
"/usr/bin/php" "/home/vitex/Projects/SpojeNetIT/csas-accountsapi/Examples/balance.php"
42+
SpojeNET\CSas\Model\GetAccountBalance200Response Object
43+
(
44+
[openAPINullablesSetToNull:protected] => Array
45+
(
46+
)
47+
48+
[container:protected] => Array
49+
(
50+
[balances] => Array
51+
(
52+
[0] => SpojeNET\CSas\Model\GetAccountBalance200ResponseBalancesInner Object
53+
(
54+
[openAPINullablesSetToNull:protected] => Array
55+
(
56+
)
57+
58+
[container:protected] => Array
59+
(
60+
[type] => SpojeNET\CSas\Model\GetAccountBalance200ResponseBalancesInnerType Object
61+
(
62+
[openAPINullablesSetToNull:protected] => Array
63+
(
64+
)
65+
66+
[container:protected] => Array
67+
(
68+
[codeOrProprietary] => SpojeNET\CSas\Model\GetAccountBalance200ResponseBalancesInnerTypeCodeOrProprietary Object
69+
(
70+
[openAPINullablesSetToNull:protected] => Array
71+
(
72+
)
73+
74+
[container:protected] => Array
75+
(
76+
[code] => CLAV
77+
)
78+
79+
)
80+
81+
)
82+
83+
)
84+
85+
[amount] => SpojeNET\CSas\Model\GetAccountBalance200ResponseBalancesInnerAmount Object
86+
(
87+
[openAPINullablesSetToNull:protected] => Array
88+
(
89+
)
90+
91+
[container:protected] => Array
92+
(
93+
[value] => 48923.15
94+
[currency] => CZK
95+
)
96+
97+
)
98+
99+
[creditDebitIndicator] => DBIT
100+
[date] => SpojeNET\CSas\Model\GetAccountBalance200ResponseBalancesInnerDate Object
101+
(
102+
[openAPINullablesSetToNull:protected] => Array
103+
(
104+
)
105+
106+
[container:protected] => Array
107+
(
108+
[dateTime] => DateTime Object
109+
(
110+
[date] => 2017-02-17 12:32:41.000000
111+
[timezone_type] => 2
112+
[timezone] => Z
113+
)
114+
115+
)
116+
117+
)
118+
119+
)
120+
121+
)
122+
123+
)
124+
125+
)
126+
127+
)
128+
*/

Examples/statements.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,33 @@
1212
* For the full copyright and license information, please view the LICENSE
1313
* file that was distributed with this source code.
1414
*/
15-
1615
use Ease\Shared as Shr;
1716

18-
require_once \dirname(__DIR__).'/vendor/autoload.php';
17+
require_once \dirname(__DIR__) . '/vendor/autoload.php';
18+
19+
Shr::init(['CSAS_API_KEY', 'CSAS_ACCESS_TOKEN', 'CSAS_SANDBOX_MODE'], \dirname(__DIR__) . '/.env');
1920

20-
Shr::init(['CSAS_API_KEY', 'CSAS_ACCESS_TOKEN', 'CSAS_API_DEBUG', 'CSAS_SANDBOX_MODE'], \dirname(__DIR__).'/.env');
21+
// Keep your tokens fresh using https://github.com/Spoje-NET/csas-authorize.git
2122

2223
$apiInstance = new \SpojeNET\CSas\Accounts\DefaultApi(new SpojeNET\CSas\ApiClient(
23-
[
24-
'apikey' => Shr::cfg('CSAS_API_KEY'),
25-
'token' => Shr::cfg('CSAS_ACCESS_TOKEN'),
26-
'debug' => Shr::cfg('CSAS_API_DEBUG', false),
27-
'sandbox' => Shr::cfg('CSAS_SANDBOX_MODE'),
28-
],
29-
));
24+
[
25+
'apikey' => Shr::cfg('CSAS_API_KEY'),
26+
'token' => Shr::cfg('CSAS_ACCESS_TOKEN'),
27+
'debug' => Shr::cfg('CSAS_API_DEBUG', false),
28+
'sandbox' => Shr::cfg('CSAS_SANDBOX_MODE'),
29+
],
30+
));
3031

3132
try {
3233
$toDate = new \DateTime();
3334
$fromDate = (clone $toDate)->modify('-1 month');
3435

3536
// See: https://jsapi.apiary.io/apis/eahaccountsapiv3prod/reference/statements/list-of-statements/get-statements-list.html
3637

37-
$result = $apiInstance->getStatements('AA195E7DB499B4D9F48D46C208625FF53F2245F7', $fromDate->format('Y-m-d'), $toDate->format('Y-m-d'));
38+
$account = Shr::cfg('CSAS_ACCOUNT_IBAN');
39+
'AA195E7DB499B4D9F48D46C208625FF53F2245F7';
40+
41+
$result = $apiInstance->getStatements($account, $fromDate->format('Y-m-d'), $toDate->format('Y-m-d'));
3842

3943
print_r($result);
4044
} catch (Exception $e) {

0 commit comments

Comments
 (0)