ebics-client-php icon indicating copy to clipboard operation
ebics-client-php copied to clipboard

EBICS_INVALID_XML since v2.3.0 / switch to ebics-api/ebics-client-php

Open mkrasselt1 opened this issue 1 year ago • 7 comments

Dear Andrew Severin, I tried everything to debug this strange error message: I get the EBICS_INVALID_XML error for male formed XML from my bank when i tried to upload a cdd request to my bank. The xml file itself is valid(its been accepted through the web interface of my bank) and i debugged it as far as the RequestFactory25.php file creating a Transfer which is valid xml as well. i think it breaks within the signature adding part. I solved it by a rollback to andrew-svirin/ebics-client-php: v2.2.1 I will try to make a diff between the versions. (or is the used software part of the signature and whitelisted by my bank?)

mkrasselt1 avatar Feb 19 '25 19:02 mkrasselt1

Hi @mkrasselt1 try to play with utf-8 encoding. If you find a solution please share here.

andrew-svirin avatar Feb 19 '25 20:02 andrew-svirin

what do you mean by that? trying to utf8 encode the xml file to be transmitted? I tried changing the encoding using vscode encoding feature (setting to utf-8, utf-8-bom and iso 1252 made no difference

mkrasselt1 avatar Feb 19 '25 22:02 mkrasselt1

I have been using Sephpa XML Library with SephpaDirectDebit::SEPA_PAIN_008_001_02 and this code:

        //upload phase
        $keyRingManager = new FileKeyringManager();
        $keyRing        = $keyRingManager->loadKeyRing("./config/" . $this->config["keyRing"], $this->config["keyRingPassword"], Keyring::VERSION_25);
        $bank           = new Bank($this->config["hostId"], $this->config["hostUrl"]);
        $bank->setServerName($this->config["serverName"]);

        $client    = new EbicsClient($bank, new ModelsUser($this->config["partnerId"], $this->config["userId"]), $keyRing);
        $orderData = new Document();
        $orderData->load(__DIR__ . "/DirectDebit-20250213-085928.xml");
         return $client->CDD($orderData);

mkrasselt1 avatar Feb 19 '25 22:02 mkrasselt1

This is the file i am using - obviously anonymised

<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02 pain.008.001.02.xsd">
    <CstmrDrctDbtInitn>
        <GrpHdr>
            <MsgId>XXXXXXXXXXXXXXX</MsgId>
            <CreDtTm>2025-02-13T08:59:28</CreDtTm>
            <NbOfTxs>1</NbOfTxs>
            <CtrlSum>15.00</CtrlSum>
            <InitgPty>
                <Nm>PeanutPay GmbH</Nm>
            </InitgPty>
        </GrpHdr>
        <PmtInf>
            <PmtInfId>XXXXXXXXXXXXXXX</PmtInfId>
            <PmtMtd>DD</PmtMtd>
            <NbOfTxs>1</NbOfTxs>
            <CtrlSum>15.00</CtrlSum>
            <PmtTpInf>
                <SvcLvl>
                    <Cd>SEPA</Cd>
                </SvcLvl>
                <LclInstrm>
                    <Cd>CORE</Cd>
                </LclInstrm>
                <SeqTp>RCUR</SeqTp>
            </PmtTpInf>
            <ReqdColltnDt>2025-02-18</ReqdColltnDt>
            <Cdtr>
                <Nm>XXXXXXXXXXXXXXX</Nm>
            </Cdtr>
            <CdtrAcct>
                <Id>
                    <IBAN>XXXXXXXXXXXXXXXXXXXX</IBAN>
                </Id>
                <Ccy>EUR</Ccy>
            </CdtrAcct>
            <CdtrAgt>
                <FinInstnId>
                    <BIC>XXXXXXXX</BIC>
                </FinInstnId>
            </CdtrAgt>
            <ChrgBr>SLEV</ChrgBr>
            <CdtrSchmeId>
                <Id>
                    <PrvtId>
                        <Othr>
                            <Id>XXXXXXXXXXXXXX</Id>
                            <SchmeNm>
                                <Prtry>SEPA</Prtry>
                            </SchmeNm>
                        </Othr>
                    </PrvtId>
                </Id>
            </CdtrSchmeId>
            <DrctDbtTxInf>
                <PmtId>
                    <EndToEndId>970100</EndToEndId>
                </PmtId>
                <InstdAmt Ccy="EUR">15.00</InstdAmt>
                <DrctDbtTx>
                    <MndtRltdInf>
                        <MndtId>XXXXXXXXXXXX</MndtId>
                        <DtOfSgntr>2025-02-13</DtOfSgntr>
                    </MndtRltdInf>
                </DrctDbtTx>
                <DbtrAgt>
                    <FinInstnId>
                        <BIC>XXXXXXXXXX</BIC>
                    </FinInstnId>
                </DbtrAgt>
                <Dbtr>
                    <Nm>XXXXX XXXXX</Nm>
                </Dbtr>
                <DbtrAcct>
                    <Id>
                        <IBAN>DE74XXXXXXXXXXXXXXXX</IBAN>
                    </Id>
                </DbtrAcct>
                <RmtInf>
                    <Ustrd>message here</Ustrd>
                </RmtInf>
            </DrctDbtTxInf>
        </PmtInf>
    </CstmrDrctDbtInitn>
</Document>

mkrasselt1 avatar Feb 19 '25 22:02 mkrasselt1

There are no umlauts symbols in the text values?

andrew-svirin avatar Feb 20 '25 08:02 andrew-svirin

Sadly not at all. That's one of the first thing I checked. I even used html special chars and checked that the contents remain the same. (even with plain acsii) Where would i need to change to compare/save the output of those different versions for comparison?

mkrasselt1 avatar Feb 20 '25 09:02 mkrasselt1

You can try to ask your bank about concrete message why the document is not delivered well.

andrew-svirin avatar Feb 21 '25 18:02 andrew-svirin