digitick / php-sepa-xml

* THIS PROJECT IS NO LONGER MAINTAINED* SEPA file generator in PHP
107 stars 63 forks source link

InitgPty, Spanish banks and organizations #44

Closed rmontagud closed 7 years ago

rmontagud commented 10 years ago

Hello,

Several Spanish banks (pain.008.001.02) require to add additional data related to the organization ID and other data, but the ID seems mandatory so far, when the initiating party is an organization so the final result looks like this

<InitgPty>
    <Nm>Initiating Party Name</Nm>
    <Id>
        <OrgId>
            <Othr>
                <Id>CCNNNNNXZZZZZZZZ</Id>
            </Othr>
        </OrgId>
    </Id>
</InitgPty>

Source: Spanish Bank Association (pdf) page 18, in Spanish only, sorry :-/

alexmoleiro commented 9 years ago

I have coded a proxy to deal with Banc Sabadel, a spanish bank https://twitter.com/MoleiroAlex/status/586291614924021760

israelromosen commented 9 years ago

I had to do the modification that indicates @montagud, but it does not work for me I needed to include the tag called InitgPty->Id->OrgId->Othr->Id . For to do this, I added function visitGroupHeader in CustomerDirectDebitTransferDomBuilder and modified construct function GroupHeader like this:

function __construct($messageIdentification, $initiatingPartyName, $initiatingPartyId $test = false)
{
    $this->messageIdentification = $messageIdentification;
    $this->initiatingPartyId = $initiatingPartyId;
    $this->initiatingPartyName = StringHelper::sanitizeString($initiatingPartyName);
    $this->creationDateTime = new \DateTime();
}

Now, works fine.

Thank you a lot of much for all

alexmoleiro commented 9 years ago

Israel: Yo've done the same patch I suggested in my tweet. You can chek it and grab the class I've coded especially for spanish banking

rmontagud commented 9 years ago

Did you try with the latest stable release? Also, remember this project is no longer active since it's been forked to it's own organization since none of the authors works at Digitick right now https://github.com/php-sepa-xml/php-sepa-xml

BenjaminPaap commented 9 years ago

More important is that none of Digiticks employees seem responsible and they seem to have no interest in maintaining this anymore.

eusonlito commented 9 years ago

@alexmoleiro, I think that a abstract factory from GroupHeader is a better solution than a specific bank related function.

Check my example https://github.com/eusonlito/php-sepa-xml#sample-usage-directdebit-with-factory-and-custom-header and code https://github.com/eusonlito/php-sepa-xml/blob/master/lib/Digitick/Sepa/TransferFile/Factory/TransferFileFacadeFactory.php