-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.php
40 lines (21 loc) · 901 Bytes
/
run.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
<?php
require __DIR__.'/vendor/autoload.php';
include_once 'Yodlee.php';
include 'Crypt/RSA.php';
$accounts_url = 'https://stage.api.yodlee.uk/ysl/accounts';
$api_key = 'xxx'; // REDACTED
$base_transactions_url = 'https://stage.api.yodlee.uk/ysl/transactions';
$private_key_file = 'private.pem';
$public_key_file = 'private.pem';
$transactions = [];
$username = 'xxx'; // REDACTED
$user_jwt_token = Yodlee::generateJWTToken($api_key, $private_key_file, $username);
$accounts = Yodlee::getUserAccounts($user_jwt_token, $accounts_url);
$from_date = '2021-10-01';
foreach ($accounts as $account) {
$transactions_url = $base_transactions_url.'?fromDate='.$from_date.'+&accountId='.$account->id;
$transactions[$account->id] = Yodlee::getTransactions($user_jwt_token, $transactions_url);
}
file_put_contents('transactions.json', json_encode($transactions));
dd($transactions);
?>