-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.php
More file actions
54 lines (47 loc) · 1.51 KB
/
Copy pathexample.php
File metadata and controls
54 lines (47 loc) · 1.51 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
require_once('HSBC_France.php');
$hsbc_france = new Bank_hsbc_fr();
$hsbc_france->setAccountNumber('11111111111111');
$hsbc_france->setPassword('111111');
$result = $hsbc_france->connect();
if($result['code'] !== 1){
/*
* code: 0 unknown, no connection
* code: 2 bad password (wrong characters)
* code: 3 bad password
*/
throw new Exception('Could not connect to the bank');
}else{
echo '<pre>';
print_r($result);
/*
* returns an array like this:
*
* Array
(
[code] => 1
[accounts] => Array
(
[0] => Array
(
[name] => M. ANDREI DUPONT
[balance] => 131,54
[currency] => EUR
)
[1] => Array
(
[name] => LIVRAIT A
[balance] => 15,54
[currency] => EUR
)
[2] => Array
(
[name] => LIVRET HSBC EPARGNE
[balance] => 820,00
[currency] => EUR
)
)
)
*/
}
?>