{"id":15029942,"url":"https://github.com/abcaeffchen/sepautilities","last_synced_at":"2025-04-04T21:09:47.735Z","repository":{"id":21985757,"uuid":"25310698","full_name":"AbcAeffchen/SepaUtilities","owner":"AbcAeffchen","description":"SepaUtilities provides useful methods for validating and sanitizing inputs used in SEPA files supporting PHP \u003e= 8.1.","archived":false,"fork":false,"pushed_at":"2025-02-12T15:31:07.000Z","size":23567,"stargazers_count":31,"open_issues_count":0,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-04T21:09:43.211Z","etag":null,"topics":["php","sanitizer","sepa"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AbcAeffchen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGE_LOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"AbcAeffchen"}},"created_at":"2014-10-16T16:19:14.000Z","updated_at":"2025-02-12T15:31:11.000Z","dependencies_parsed_at":"2025-02-12T16:22:03.983Z","dependency_job_id":"1bfc594d-226f-4939-a1b0-1f2c91dea2e1","html_url":"https://github.com/AbcAeffchen/SepaUtilities","commit_stats":{"total_commits":109,"total_committers":6,"mean_commits":"18.166666666666668","dds":0.3853211009174312,"last_synced_commit":"eca4deeb06ae6c784dbb71cf349d0f81e7a9869b"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbcAeffchen%2FSepaUtilities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbcAeffchen%2FSepaUtilities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbcAeffchen%2FSepaUtilities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbcAeffchen%2FSepaUtilities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AbcAeffchen","download_url":"https://codeload.github.com/AbcAeffchen/SepaUtilities/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249532,"owners_count":20908212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","sanitizer","sepa"],"created_at":"2024-09-24T20:12:02.886Z","updated_at":"2025-04-04T21:09:47.719Z","avatar_url":"https://github.com/AbcAeffchen.png","language":"PHP","funding_links":["https://github.com/sponsors/AbcAeffchen"],"categories":[],"sub_categories":[],"readme":"SepaUtilities\n===============\n\n[![Unit Tests](https://github.com/AbcAeffchen/SepaUtilities/actions/workflows/php.yml/badge.svg)](https://github.com/AbcAeffchen/SepaUtilities/actions/workflows/php.yml)\n[![Latest Stable Version](https://poser.pugx.org/abcaeffchen/sepa-utilities/v/stable.svg)](https://packagist.org/packages/abcaeffchen/sepa-utilities) \n[![Total Downloads](https://poser.pugx.org/abcaeffchen/sepa-utilities/downloads.svg)](https://packagist.org/packages/abcaeffchen/sepa-utilities) \n[![License](https://poser.pugx.org/abcaeffchen/sepa-utilities/license.svg)](https://packagist.org/packages/abcaeffchen/sepa-utilities)\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/AbcAeffchen/SepaUtilities?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\n## General\nSepaUtilities is a PHP class to check and sanitize inputs used in SEPA files\nsuch as IBAN numbers, creditor identifiers, names and other text.\n\n## PHP Versions\nSepaUtilities supports PHP \u003e= 8.1.\n\n## Installation\n\n### Composer\nYou can get SepaUtilities via Composer. Just add\n\n```json\n{\n    \"require\": {\n        \"abcaeffchen/sepa-utilities\": \"^2.0\"\n    }\n}\n```\n\nto your composer.json.\n\n### Direct download\nIf you don't use Composer, you can download `SepaUtilities.php` and just include it into your\nPHP files. Make sure you use the namespace `AbcAeffchen\\SepaUtilities\\`.\n\n## The Utilities\nHave a look at the [documentation](http://htmlpreview.github.io/?https://raw.githubusercontent.com/AbcAeffchen/SepaUtilities/master/docs/html/index.html).\n### Checks\n- `checkIBAN($iban)`: Checks if the IBAN is valid by checking the format and by calculating the checksum and also removes whitespaces and changes all letters to upper case.\n- `checkBIC($bic)`: Checks if the BIC is valid by checking the format and also removes whitespaces\nand changes all letters to upper case.\n- `crossCheckIbanBic($iban, $bic)`: Checks if IBAN and BIC belong to the same country.\n- `isNationalTransaction($iban1,$iban2)`: Checks if both IBANs are belong to the same country.\n- `checkCharset($str)`: Checks if the string contains only allowed characters.\n- `check($field, $input, $options, $version)`: Checks if the input fits the field. This function also does little\nformat changes, e.g. correcting letter case. Possible field values are (case-insensitive):\n  - `initgpty`: Initiating Party\n  - `initgptyid`: Initiating Party ID\n  - `msgid`: Message ID\n  - `pmtid`: Payment ID\n  - `pmtinfid`: Payment Information ID\n  - `cdtr`: Creditor Name\n  - `ultmtcdrt`: Ultimate Creditor\n  - `dbtr`: Debtor Name\n  - `ultmtdebtr`: Ultimate Debtor\n  - `ultmtdbtrid`: Ultimate Debtor ID\n  - `iban`: IBAN\n  - `bic`: BIC\n  - `ccy`: Currency\n  - `btchbookg`: Batch Booking (boolean as string)\n  - `instdamt`: Instructed Amount\n  - `rmtinf`: Remittance Information\n  - `ci`: Creditor Identifier\n  - `seqtp`: Sequence Type\n  - `lclinstrm`: Local Instrument\n  - `ctry`: Two-letter country code, used in postal address\n  - Subfield of `pstlAdr`\n    - `adrline`: An address line, or an array of at most two address lines\n    - `bldgnm`: Building name\n    - `bldgnb`: Building number\n    - `twnnm`: Town name\n    - `twnlctnnm`: Town location name (within a town)\n    - `dstrctnm`: District name\n    - `ctrysubdvsn`: country subdivision, e.g. state, region, county\n    - `pstbx`: Postbox\n    - `pstcd`: Postal code\n    - `dept`: Department\n    - `subdept`: Subdepartment\n    - `strtnm`: Street name\n    - `flr`: Floor\n    - `room`: Room\n\nThe `$options` take an array \n### Sanitizing\n- `sanitizeLength($input, $maxLen)`: Shortens the string if it is to long.\n- `sanitizeShortText($input,$allowEmpty, $flags)`: Sanitizes the the charset and shortens the text if necessary.\n- `sanitizeLongText($input,$allowEmpty, $flags)`: Sanitizes the the charset and shortens the text if necessary.\n- `replaceSpecialChars($str)`: replaces all characters that are not allowed in sepa files by a\nallowed one or removes them. Take a look at this [.xls file](http://www.europeanpaymentscouncil.eu/index.cfm/knowledge-bank/epc-documents/sepa-requirements-for-an-extended-character-set-unicode-subset-best-practices/) for more information\n*Notice:* Cyrillic is not supported yet, but greek letters are.\n- `sanitize($field, $input, $flags)`: tries to sanitize the input, so it fits the field. Possible fields are\n  - `cdtr`\n  - `dbtr`\n  - `rmtinf`\n  - `ultmtcdrt`\n  - `ultmtdebtr`\n  - `adrline`\n\n### Wrappers\n- `checkAndSanitize($field, $input, $flags, $options)`: Checks the input and if it is not valid \nit tries to sanitize it.\n- `checkAndSanitizeAll(\u0026$inputs, $flags, $options)`: Takes an array of inputs (field =\u003e value)\nand checks and sanitizes each of the fields. The input array is handed over as reference, so the\nresult will be direct effect the input array. The return value is true, if everything is ok and\nelse a string with problematic fields.\n\n### Date functions\n- `getDate($date, $inputFormat)`: Returns $date in a SEPA-valid format. You can specify the\ninput format by using [the table on this site](http://de1.php.net/manual/en/function.date.php).\nBy default the german date format (DD.MM.YYYY) is used.\n- `getDateWithOffset($workdayOffset, $today, $inputFormat)`: Computes the next [TARGET2](http://en.wikipedia.org/wiki/TARGET2#TARGET2_holidays)\n day (including today) with respect to an offset.\n- `getDateWithMinOffsetFromToday($target, $workdayMinOffset, $inputFormat, $today)`: Returns the \ntarget date, if it has at least the given offset of TARGET2 days form today. Else the earliest date \nthat respects the offset is returned.\n\n### Patterns\n- `HTML_PATTERN_IBAN`\n- `HTML_PATTERN_BIC`\n- `PATTERN_IBAN`\n- `PATTERN_BIC`\n- `PATTERN_CREDITOR_IDENTIFIER`\n- `PATTERN_SHORT_TEXT`\n- `PATTERN_LONG_TEXT`\n- `PATTERN_RESTRICTED_IDENTIFICATION_SEPA1`\n- `PATTERN_MANDATE_ID`\n\nThe `HTML_PATTERN_*` constants can be used as HTML5 pattern attribute. It is user friendlier than \nthe corresponding `PATTERN_*` as they allow lowercase characters and whitespaces. This is corrected \nby the `check` methods.\n\n## Licence\nSepaUtilities is licensed under the LGPL v3.0 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabcaeffchen%2Fsepautilities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabcaeffchen%2Fsepautilities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabcaeffchen%2Fsepautilities/lists"}