Closed degitpatrick closed 3 years ago
Any news on this?
Sorry, I was very busy.
It took me a while to check why this is obviously a bug but the tests are were passing none the less. Turns out that 'empty' was not tested. Just 'not set at all'.
However, I merged #37 and will add a followup commit to extend the tests.
Looking at SepaCreditTransfer00100103::addPayment, a check is done to determine if a BIC code is required. This is done by checking SepaUtilities::isEEATransaction and then flipping the result. So if the 2 IBANs are both EEA accounts, SepaUtilities::isEEATransaction will return true, which will be flipped so $bicRequired becomes false.
Next, we see this call: SepaUtilities::checkAndSanitizeAll( $paymentInfo, $this->sanitizeFlags, ['allowEmptyBic' => $bicRequired] );
This would imply that if $bicRequired is false, allowEmptyBic will also be false, so even though no BIC code is required, no empty BIC code is allowed.
At the moment the only way to work around this would be to remove the 'bic' element from the payment array.