Skip to content

Class SepaCntryValidationDE

Stefan Kientzler edited this page Aug 25, 2021 · 9 revisions

Full name:     \SKien\Sepa\CntryValidation\SepaCntryValidationDE
Parent class:    \SKien\Sepa\CntryValidation\SepaCntryValidationBase


Validation class for german IBAN and CI

Valid testvalues

IBAN DE11 6829 0000 0009 2158 08
BIC GENODE61LAH
CI DE79 ZZZ 01234567890 / DE98 ZZZ 09999999999

IBAN format

CCpp bbbb bbbb kkkk kkkk kk

CC ISO Country Code
pp 2 digits IBAN checksum
b banking code 8 digits
k account number 10 digits

Length: 22

CI format

CCpp ZZZ 0nnnnnnnnnn

C ISO Country Code
p 2 digits IBAN checksum
Z 3 digits alphanum creditor business code
0 1 digit fixed value 0
n 10 digits numeric national identification code

Length: 18

All validation can be done with specification of length and regex to match format!

Overview

Method Description
__construct Create instance of german validation.
validateBIC Validates given BIC.
validateCI Validates given CI (Creditor Scheme Identification).
validateIBAN Validates given IBAN.

Methods

__construct

Create instance of german validation.

public SepaCntryValidationDE::__construct(string $strCntry)

Parameters:

Parameter Type Description
strCntry string 2 sign country code

[go to top]


Inherited methods

validateBIC

Validates given BIC.

public SepaCntryValidationBase::validateBIC(string $strBIC) : int

Follows ISO 9362
as far as I have determined, the format of the BIC is uniform within the participating countries for SEPA.

Parameters:

Parameter Type Description
strBIC string BIC to validate

Return Type: int

Sepa::OK or errorcode

  • Sepa::ERR_BIC_INVALID invalid BIC
  • Sepa::ERR_BIC_INVALID_CNTRY invalid country code

[go to top]


validateCI

Validates given CI (Creditor Scheme Identification).

public SepaCntryValidationBase::validateCI(string $strCI) : int

The general structure for the CI is the following:

  • Position 1-2 filled with the ISO country code
  • Position 3-4 filled with the check digit according to ISO 7064 Mod 97-10
  • Position 5-7 filled with the Creditor Business Code, if not used then filled with ZZZ
  • Position 8 onwards filled with the country specific part of the identifier being a national identifier of the Creditor as defined by the concerned national community.

NOTE: the CBC is not taken into account when calculating the checksum!

Parameters:

Parameter Type Description
strCI string CI to validate

Return Type: int

Sepa::OK or errorcode

  • Sepa::ERR_CI_INVALID_CNTRY invalid country code
  • Sepa::ERR_CI_INVALID_LENGTH invalid length
  • Sepa::ERR_CI_INVALID_SIGN CI contains invalid sign(s)
  • Sepa::ERR_CI_CHECKSUM wrong checksum

See Also:

[go to top]


validateIBAN

Validates given IBAN.

public SepaCntryValidationBase::validateIBAN(string $strIBAN) : int

Parameters:

Parameter Type Description
strIBAN string IBAN to validate

Return Type: int

Sepa::OK or errorcode

  • Sepa::ERR_IBAN_INVALID_CNTRY invalid country code
  • Sepa::ERR_IBAN_INVALID_LENGTH invalid length
  • Sepa::ERR_IBAN_INVALID_SIGN IBAN contains invalid sign(s)
  • Sepa::ERR_IBAN_CHECKSUM wrong checksum

See Also:

[go to top]


Clone this wiki locally