Skip to content

Commit

Permalink
Merge pull request #4 from valsplat/fix/not-provided-bic
Browse files Browse the repository at this point in the history
fix: put NOTPROVIDED code in correct position
  • Loading branch information
perryfaro authored Jan 6, 2021
2 parents f2e9b4c + d20ac96 commit fb38002
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Builder/CreditTransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,15 @@ protected function appendPayments($payments) {

$creditorAgent = $this->createElement('CdtrAgt');
$financialInstitution = $this->createElement('FinInstnId');
$financialInstitution->appendChild($this->createElement('BIC', $payment->getCreditorBIC()));

if ($payment->getCreditorBIC() === 'NOTPROVIDED') {
$financialInstitutionOther = $this->createElement('Othr');
$financialInstitutionOther->appendChild($this->createElement('Id', $payment->getCreditorBIC()));
$financialInstitution->appendChild($financialInstitutionOther);
} else {
$financialInstitution->appendChild($this->createElement('BIC', $payment->getCreditorBIC()));
}

$creditorAgent->appendChild($financialInstitution);
$creditTransferTransactionInformation->appendChild($creditorAgent);

Expand Down

0 comments on commit fb38002

Please sign in to comment.