Closed chland closed 3 years ago
Good to know. At the moment it is not supported. I will take a look into this and try to add support, but as always it will probably take some time.
Just looked a bit into it. Seems like these fields are madatory if you wanna deal with Direct Debits from non-EU countries like Switzerland (CH), Monaco (MC), San Marino (SM), Jersey (JE), Guernsey (GG), Isle of Man (IM), St. Pierre and Miquelon (PM).
Reason is this EU-regulation: https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:32015R0847
Thanks for the research. I try to add the support as quickly as possible.
Address information is now supported in all Credit Transfer versions. Have a look in the wiki page for more details.
Hey, thanks for adding the address-information. I did some quick tests and it seems like you only added it to transfers but not the DirectDebit-classes.
Unfortunately I don't have GIT installed on this machine right now so I can't post a PR easily but I thought I would quickly post my solution. I copied your code from the SepaCreditTransfer.php files to the SepaDirectDebit.php files and modified it slightly. I added this code-block:
if(isset($payment['dbtrPstlAdr']))
{
$pstlAdr = $drctDbtTxInf->Dbtr->addChild('PstlAdr');
if(isset($payment['dbtrPstlAdr']['ctry']))
$pstlAdr->addChild('Ctry', $payment['dbtrPstlAdr']['ctry']);
if(isset($payment['dbtrPstlAdr']['adrLine']))
{
foreach(is_array($payment['dbtrPstlAdr']['adrLine'])
? $payment['dbtrPstlAdr']['adrLine']
: [$payment['dbtrPstlAdr']['adrLine']] as $adrLine)
$pstlAdr->addChild('AdrLine', $adrLine);
}
}
after the
$drctDbtTxInf->addChild('Dbtr')->addChild('Nm', $payment['dbtr']);
line in the generatePaymentXml() function and this seems to do the trick. If I now add something like
'dbtrPstlAdr' => ['ctry' => 'DE', 'adrLine' => 'Talalaweg 123, 12345 Blubbhausen, Deutschland']
to the payment-Array it adds the Country/AdrLine to the XML.
Ah, that is true. I only added it to Credit Transfer files. I will add it to Direct Debit files as soon as possible.
A little update on this topic. It turns out that this feature is far less complete as I thought.
There is a PstlAdr
for both creditor and debtor and for for both credit transfer and direct debit. Of this four only one is currently implemented.
This week is quite full, but I try to add all missing parts until next weekend.
Is it possible to add the postal address to the Dbtr-Tag? Right now it seems like you can only add the "Nm"-Tag but not the address-fields (PstlAdr, Ctry, AdrLine, etc.)
`
It seems that direct debits fail if you use a foreign IBAN but don't provide any address-informations (at least Postbank denied all foreign transfers with that explaination)