-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathAccountNumber.php
82 lines (68 loc) · 1.98 KB
/
AccountNumber.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
namespace byrokrat\banking;
use byrokrat\banking\Formatter\FormatterInterface;
/**
* Account number interface
*/
interface AccountNumber
{
/**
* Get name of the Bank this number belongs to
*/
public function getBankName(): string;
/**
* Get the raw number
*/
public function getRawNumber(): string;
/**
* Format this number using a formatter
*/
public function format(FormatterInterface $formatter): string;
/**
* Get account number as a formatted string
*/
public function getNumber(): string;
/**
* Get account number as a formatted string
*/
public function __toString(): string;
/**
* Similar to getNumber() but with more eye candy
*/
public function prettyprint(): string;
/**
* Get account as a 16 digit number
*
* Clearing number (4 digits) + x number of ceros + serial number
*/
public function get16(): string;
/**
* Get clearing number (4 digits)
*/
public function getClearingNumber(): string;
/**
* Get the check digit of the clearing number (1 or 0 digits)
*/
public function getClearingCheckDigit(): string;
/**
* Get account serial number (1 to 11 digits)
*/
public function getSerialNumber(): string;
/**
* Get account check digit (1 digit)
*/
public function getCheckDigit(): string;
/**
* Check if account is considered equal to this account
*
* The bank name, clearing, serial and check digits must match for
* accounts to be considered equal.
*
* If a clearing check digits are present in both accounts they must
* match. If only one account contain a clearing check digit it is
* ignored, except when strict mode is enforced. In strict mode a
* missing clearing check digit on one of the accounts is considered
* a sign of non-equality.
*/
public function equals(AccountNumber $account, bool $strict = false): bool;
}