Skip to content

Commit

Permalink
fix BIC validation (closes #11)
Browse files Browse the repository at this point in the history
  • Loading branch information
AegisVP committed Sep 21, 2023
1 parent 5d8a9b4 commit 982bb33
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,8 @@ public function setIdentification(string $identification = 'SCT'): static

public function setBic(string $bic): static
{
if (strlen($bic) < 8) {
throw new Exception('BIC of the beneficiary bank cannot be shorter than 8 characters');
}

if (strlen($bic) > 11) {
throw new Exception('BIC of the beneficiary bank cannot be longer than 11 characters');
if (strlen($bic) !== 8 && strlen($bic) !== 11) {
throw new Exception('BIC of the beneficiary bank can be 8 or 11 characters');
}

$this->sepaValues['bic'] = $bic;
Expand Down

0 comments on commit 982bb33

Please sign in to comment.