raphaelm / python-sepaxml

SEPA Direct Debit XML generation in python
MIT License
112 stars 43 forks source link

`pain.001.001.03` raises `sepaxml.validation.ValidationError` with example data #49

Closed sweh closed 2 years ago

sweh commented 2 years ago

With the example data from the README, I get an

xmlschema.validators.exceptions.XMLSchemaChildrenValidationError: failed validating <Element '{urn:iso:std:iso:20022:tech:xsd:pain.001.001.03}Document' at 0x101f3d188> with XsdGroup(model='sequence', occurs=[1, 1]):

Reason: Unexpected child with tag '{urn:iso:std:iso:20022:tech:xsd:pain.001.001.03}CstmrDrctDbtInitn' at position 1. Tag 'CstmrCdtTrfInitn' expected.

Schema:

  <xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Document">
      <xs:sequence>
          <xs:element name="CstmrCdtTrfInitn" type="CustomerCreditTransferInitiationV03" />
      </xs:sequence>
  </xs:complexType>

Can you guess what's going wrong?

raphaelm commented 2 years ago

This looks like you are using the classes for direct debit even though pain.001.* is the format for transfers