Skip to content

Commit 4541f55

Browse files
committed
Add support for pain.001.001.09 and pain.008.01.08.
1 parent ff6cf22 commit 4541f55

File tree

4 files changed

+127
-29
lines changed

4 files changed

+127
-29
lines changed

CHANGE_LOG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1-
Sephpa - Change Log
1+
SepaUtilities - Change Log
22
===============
33

4+
## 2.0.0 - Jan 20, 24
5+
- Minimal required PHP version is now 8.1 as it is the currently oldest supported version.
6+
- **Add support for pain.001.001.09 and pain.008.001.08.**
7+
- `check()` supports new fields: `reqdexctndttm`, subfields of `pstladr` (`bldgnm`,`bldgnb`, `twnnm`, `twnlctnnm`, `dstrctnm`,
8+
`ctrysubdvsn`, `pstbx`, `pstcd`, `dept`, `subdept`, `strtnm`, `flr`, `room`). All fields are case-insensitive.
9+
- Add missing parameter and return types.
10+
- `getDate()`, `getDateWithOffset()` do not throw anymore to simplify checking for errors.
11+
- `checkAndSanitizeAll()` now returns an array instead of a string in case of an error.
12+
13+
# 1.3.4 - Sep 8, 21
14+
- Add key `orgid_sm` to the check and sanitize functions.
15+
416
## 1.3.3 - Mar 4, 21
517
- Fixed typo in `ultmtCdtr` (was `ultmtCdrt` before). The old version still works for backward compatibility.
618

@@ -84,7 +96,7 @@ and was never officially supported anyway.
8496

8597
## 1.0.7 - Dec 18, '14
8698
- added `checkInput()`,`sanitizeInput()` and `checkAndSanitizeInput()` to validate user inputs.
87-
With this functions it is not required to check first, if an array index like `$_POST['key1']['key2']`
99+
With these functions it is not required to check first, if an array index like `$_POST['key1']['key2']`
88100
exists, before validating the values.
89101

90102
## 1.0.6 - Oct 24, '14

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ SepaUtilities is a PHP class to check and sanitize inputs used in SEPA files
1212
such as IBAN numbers, creditor identifiers, names and other text.
1313

1414
## PHP Versions
15-
SepaUtilities supports PHP >= 7.2 including PHP 8.
15+
SepaUtilities supports PHP >= 8.1.
1616

1717
## Installation
1818

@@ -22,7 +22,7 @@ You can get SepaUtilities via Composer. Just add
2222
```json
2323
{
2424
"require": {
25-
"abcaeffchen/sepa-utilities": "^1.3"
25+
"abcaeffchen/sepa-utilities": "^2.0"
2626
}
2727
}
2828
```
@@ -43,7 +43,7 @@ and changes all letters to upper case.
4343
- `isNationalTransaction($iban1,$iban2)`: Checks if both IBANs are belong to the same country.
4444
- `checkCharset($str)`: Checks if the string contains only allowed characters.
4545
- `check($field, $input, $options, $version)`: Checks if the input fits the field. This function also does little
46-
format changes, e.g. correcting letter case. Possible field values are:
46+
format changes, e.g. correcting letter case. Possible field values are (case-insensitive):
4747
- `initgpty`: Initiating Party
4848
- `initgptyid`: Initiating Party ID
4949
- `msgid`: Message ID
@@ -64,7 +64,21 @@ format changes, e.g. correcting letter case. Possible field values are:
6464
- `seqtp`: Sequence Type
6565
- `lclinstrm`: Local Instrument
6666
- `ctry`: Two-letter country code, used in postal address
67-
- `adrline`: An address line, or an array of at most two address lines
67+
- Subfield of `pstlAdr`
68+
- `adrline`: An address line, or an array of at most two address lines
69+
- `bldgnm`: Building name
70+
- `bldgnb`: Building number
71+
- `twnnm`: Town name
72+
- `twnlctnnm`: Town location name (within a town)
73+
- `dstrctnm`: District name
74+
- `ctrysubdvsn`: country subdivision, e.g. state, region, county
75+
- `pstbx`: Postbox
76+
- `pstcd`: Postal code
77+
- `dept`: Department
78+
- `subdept`: Subdepartment
79+
- `strtnm`: Street name
80+
- `flr`: Floor
81+
- `room`: Room
6882

6983
The `$options` take an array
7084
### Sanitizing

src/SepaUtilities.php

Lines changed: 89 additions & 23 deletions
Large diffs are not rendered by default.

tests/SepaUtilitiesTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,12 @@ public function testCheckDateFormat()
375375
static::assertFalse(SepaUtilities::checkCreateDateTime('19.10.2014'));
376376
}
377377

378+
public function testCheckDateTimeFormat()
379+
{
380+
static::assertSame('2014-10-19', SepaUtilities::check('dtofsgntr', '2014-10-19'));
381+
static::assertFalse(SepaUtilities::checkCreateDateTime('19.10.2014'));
382+
}
383+
378384
public function testCrossIbanBicCheck()
379385
{
380386
// IBAN and BIC is not validated. It is only checked if the country codes belong together.

0 commit comments

Comments
 (0)