ewngs / szamlazz.js

Node.js client for Szamlazz.hu
MIT License
38 stars 34 forks source link

kulcstartojelszo should be removed from the invoice xml #22

Closed zsapkagy closed 1 year ago

zsapkagy commented 3 years ago

I am not sure why do we have the passphrase client option in the first place. 😊 I have never used it. But the result of this option is the 'kulcstartojelszo' field in the invoice xml's beallitasok type.

The problem

And the szamlazz.hu API has started to throw errors because this field is no longer allowed in the invoice XSD.

The error:

XML beolvasási hiba. cvc-complex-type.2.4.a: Invalid content was found starting with element 'kulcstartojelszo'. One of '{"http://www.szamlazz.hu/xmlszamla":szamlaLetoltes}' is expected.

The Invoice XSD no longer contains the kulcstartojelszo field according to their documentation.

<complexType name="beallitasokTipus">
        <sequence>
            <element name="felhasznalo" type="string" maxOccurs="1" minOccurs="0"></element>
            <element name="jelszo" type="string" maxOccurs="1" minOccurs="0"></element>
            <element name="szamlaagentkulcs" type="string" maxOccurs="1" minOccurs="0"></element>
            <element name="eszamla" type="boolean" maxOccurs="1" minOccurs="1"></element>
            <element name="szamlaLetoltes" type="boolean" maxOccurs="1" minOccurs="1"></element>
            <element name="szamlaLetoltesPld" type="int" maxOccurs="1" minOccurs="0"></element>
            <element name="valaszVerzio" type="int" maxOccurs="1" minOccurs="0"></element>
            <element name="aggregator" type="string" maxOccurs="1" minOccurs="0"></element>
            <element name="guardian" type="boolean" maxOccurs="1" minOccurs="0"></element>
            <element name="cikkazoninvoice" type="boolean" maxOccurs="1" minOccurs="0"></element>

        </sequence>
    </complexType>

I have found in the changelog about this change. It is their PHP API, but still, it should be relevant.

👀 https://docs.szamlazz.hu/changelog.md

## [2.10.6] - 2021.07.30

### Removed

- removed own certificate, keychain settings functions (setKeychain, setCertificationFileName)
    - src/szamlaagent/SzamlaAgent.php
    - src/szamlaagent/SzamlaAgentSettings.php
- removed "kulcstartojelszo" field from generated xml

The solution

Removing this field resolves the problem.

I have tried to update our changelog and package.json, but not sure about the version number 🤔 🙂

mondalaci commented 1 year ago

Great catch! In the meantime, I've removed kulcstartojelszo in other commits because I forgot about your PR. Thanks for your contribution!