Skip to content

Commit

Permalink
LI IBAN numbers are also allowed beside CH numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
a-schild committed Dec 16, 2021
1 parent 3ed94d2 commit 4123e78
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class BankCreditTransferWithQRR extends BankCreditTransfer
* @param $creditorName
* @param $creditorAddress
* @param IBAN $creditorIBAN IBAN of the creditor
* @param FinancialInstitutionInterface $creditorAgent BIC or IID of the creditor's financial institution
* @param FinancialInstitutionInterface $creditorAgent BIC or IID
* of the creditor's financial institution
* You can build the IID from the IBAN number for QRR (Only CH+LI)
* @param string $creditorReference QR reference number (QRR)
*/
public function __construct(
Expand All @@ -47,7 +49,7 @@ public function __construct(
}
$this->creditorReference = $creditorReference;

if (!preg_match('/^CH[0-9]{2}3/', $creditorIBAN->normalize())) {
if (!preg_match('/^(CH|LI)[0-9]{2}3/', $creditorIBAN->normalize())) {
throw new InvalidArgumentException('The IBAN must be a QR-IBAN');
}

Expand Down

0 comments on commit 4123e78

Please sign in to comment.