AbcAeffchen / Sephpa

PHP class to create SEPA xml files for credit transfer and direct debit
GNU Lesser General Public License v3.0
71 stars 31 forks source link

Fix fix_SepaDirectDebit00800102 validation error #38

Closed sanchezfauste closed 2 years ago

sanchezfauste commented 3 years ago

Fix validation error in Spanish bank:

Identificación SEPA del presentador incorrecta. Crríjalo y reenvíe.
No se permite identificadores SEPA del presentador extranjero. Crríjalo y reenvíe.

To make it work, you must initialize SephpaDirectDebit like this:

$directDebitFile = new SephpaDirectDebit(
    $initgPty,
    $msgId,
    SephpaDirectDebit::SEPA_PAIN_008_001_02,
    array('id' => $creditorIdentifier)
);
AbcAeffchen commented 3 years ago

Thanks for the PR. If I see it correct, your bank wants you to set OrgId > Othr > SchmeNm > Prtry to the string SEPA when you use OrgId > Othr > Id.

I will check if this has any conflicts and merge after that.

AbcAeffchen commented 2 years ago

I checked for conflicts and found some. There is at least one file version, which does not support this tag. Also its specification is more general. It can contain an arbitrary text up to 35 characters.

So I cannot merge this PR and hardcode this tag with the fixed content.

However, I added a new optional key to the $orgId parameter: scheme_name. You can set it to SEPA to achieve the result your bank requires. I hope this helps.

sanchezfauste commented 2 years ago

Hi! The implemented solution satisfies our needs. Thank you very much for your help!