Remittances need files the banks accept and statements need readers for reconciliation, without external libraries: - SepaXmlWriter writes pain.001.001.09 credit transfers and pain.008.001.08 direct debits (one PmtInf per sequence and collection date), reducing texts to the SEPA Latin set and refusing what a bank would reject. - Camt053Reader reads any camt.053.001.xx by local names; CsvStatementReader reads home banking exports (UTF-8 or Windows-1252, Italian or English numbers) and guesses the layout from the header row. - The Italian pack gains RibaCbiWriter (CBI Ricevute bancarie, 120-character records IB/14/20/30/40/50/51/70/EF) and CbiStatementReader (RH/61-64/EF). - Tests validate the SEPA files against hand-written subsets of the ISO 20022 schemas, to be replaced by the official XSDs when available. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
369 lines
13 KiB
XML
369 lines
13 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
pain.001.001.09 (CustomerCreditTransferInitiationV09) - HAND-WRITTEN SUBSET.
|
|
This is not the official ISO 20022 schema: it reproduces, from the published message definition, the elements,
|
|
their order, types and facets for the part Khaemhat writes (SepaXmlWriter.CreditTransfer), with the official type
|
|
names and target namespace. Elements Khaemhat never writes are left out. Replace this file with the official
|
|
pain.001.001.09.xsd when it is available in the repository; the tests must keep passing against it.
|
|
-->
|
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.09"
|
|
targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.09"
|
|
elementFormDefault="qualified">
|
|
|
|
<xs:element name="Document" type="Document" />
|
|
|
|
<xs:complexType name="Document">
|
|
<xs:sequence>
|
|
<xs:element name="CstmrCdtTrfInitn" type="CustomerCreditTransferInitiationV09" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="CustomerCreditTransferInitiationV09">
|
|
<xs:sequence>
|
|
<xs:element name="GrpHdr" type="GroupHeader85" />
|
|
<xs:element name="PmtInf" type="PaymentInstruction30" maxOccurs="unbounded" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="GroupHeader85">
|
|
<xs:sequence>
|
|
<xs:element name="MsgId" type="Max35Text" />
|
|
<xs:element name="CreDtTm" type="ISODateTime" />
|
|
<xs:element name="NbOfTxs" type="Max15NumericText" />
|
|
<xs:element name="CtrlSum" type="DecimalNumber" minOccurs="0" />
|
|
<xs:element name="InitgPty" type="PartyIdentification135" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="PaymentInstruction30">
|
|
<xs:sequence>
|
|
<xs:element name="PmtInfId" type="Max35Text" />
|
|
<xs:element name="PmtMtd" type="PaymentMethod3Code" />
|
|
<xs:element name="BtchBookg" type="BatchBookingIndicator" minOccurs="0" />
|
|
<xs:element name="NbOfTxs" type="Max15NumericText" minOccurs="0" />
|
|
<xs:element name="CtrlSum" type="DecimalNumber" minOccurs="0" />
|
|
<xs:element name="PmtTpInf" type="PaymentTypeInformation26" minOccurs="0" />
|
|
<xs:element name="ReqdExctnDt" type="DateAndDateTime2Choice" />
|
|
<xs:element name="Dbtr" type="PartyIdentification135" />
|
|
<xs:element name="DbtrAcct" type="CashAccount38" />
|
|
<xs:element name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification6" />
|
|
<xs:element name="ChrgBr" type="ChargeBearerType1Code" minOccurs="0" />
|
|
<xs:element name="CdtTrfTxInf" type="CreditTransferTransaction34" maxOccurs="unbounded" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="PaymentTypeInformation26">
|
|
<xs:sequence>
|
|
<xs:element name="SvcLvl" type="ServiceLevel8Choice" minOccurs="0" maxOccurs="unbounded" />
|
|
<xs:element name="LclInstrm" type="LocalInstrument2Choice" minOccurs="0" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="CreditTransferTransaction34">
|
|
<xs:sequence>
|
|
<xs:element name="PmtId" type="PaymentIdentification6" />
|
|
<xs:element name="Amt" type="AmountType4Choice" />
|
|
<xs:element name="CdtrAgt" type="BranchAndFinancialInstitutionIdentification6" minOccurs="0" />
|
|
<xs:element name="Cdtr" type="PartyIdentification135" minOccurs="0" />
|
|
<xs:element name="CdtrAcct" type="CashAccount38" minOccurs="0" />
|
|
<xs:element name="RmtInf" type="RemittanceInformation16" minOccurs="0" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="PaymentIdentification6">
|
|
<xs:sequence>
|
|
<xs:element name="InstrId" type="Max35Text" minOccurs="0" />
|
|
<xs:element name="EndToEndId" type="Max35Text" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="AmountType4Choice">
|
|
<xs:choice>
|
|
<xs:element name="InstdAmt" type="ActiveOrHistoricCurrencyAndAmount" />
|
|
</xs:choice>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="DateAndDateTime2Choice">
|
|
<xs:choice>
|
|
<xs:element name="Dt" type="ISODate" />
|
|
<xs:element name="DtTm" type="ISODateTime" />
|
|
</xs:choice>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="PartyIdentification135">
|
|
<xs:sequence>
|
|
<xs:element name="Nm" type="Max140Text" minOccurs="0" />
|
|
<xs:element name="PstlAdr" type="PostalAddress24" minOccurs="0" />
|
|
<xs:element name="Id" type="Party38Choice" minOccurs="0" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="PostalAddress24">
|
|
<xs:sequence>
|
|
<xs:element name="StrtNm" type="Max70Text" minOccurs="0" />
|
|
<xs:element name="BldgNb" type="Max16Text" minOccurs="0" />
|
|
<xs:element name="PstCd" type="Max16Text" minOccurs="0" />
|
|
<xs:element name="TwnNm" type="Max35Text" minOccurs="0" />
|
|
<xs:element name="CtrySubDvsn" type="Max35Text" minOccurs="0" />
|
|
<xs:element name="Ctry" type="CountryCode" minOccurs="0" />
|
|
<xs:element name="AdrLine" type="Max70Text" minOccurs="0" maxOccurs="7" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="Party38Choice">
|
|
<xs:choice>
|
|
<xs:element name="OrgId" type="OrganisationIdentification29" />
|
|
<xs:element name="PrvtId" type="PersonIdentification13" />
|
|
</xs:choice>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="OrganisationIdentification29">
|
|
<xs:sequence>
|
|
<xs:element name="AnyBIC" type="AnyBICDec2014Identifier" minOccurs="0" />
|
|
<xs:element name="LEI" type="LEIIdentifier" minOccurs="0" />
|
|
<xs:element name="Othr" type="GenericOrganisationIdentification1" minOccurs="0" maxOccurs="unbounded" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="GenericOrganisationIdentification1">
|
|
<xs:sequence>
|
|
<xs:element name="Id" type="Max35Text" />
|
|
<xs:element name="SchmeNm" type="OrganisationIdentificationSchemeName1Choice" minOccurs="0" />
|
|
<xs:element name="Issr" type="Max35Text" minOccurs="0" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="OrganisationIdentificationSchemeName1Choice">
|
|
<xs:choice>
|
|
<xs:element name="Cd" type="ExternalOrganisationIdentification1Code" />
|
|
<xs:element name="Prtry" type="Max35Text" />
|
|
</xs:choice>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="PersonIdentification13">
|
|
<xs:sequence>
|
|
<xs:element name="Othr" type="GenericPersonIdentification1" minOccurs="0" maxOccurs="unbounded" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="GenericPersonIdentification1">
|
|
<xs:sequence>
|
|
<xs:element name="Id" type="Max35Text" />
|
|
<xs:element name="SchmeNm" type="PersonIdentificationSchemeName1Choice" minOccurs="0" />
|
|
<xs:element name="Issr" type="Max35Text" minOccurs="0" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="PersonIdentificationSchemeName1Choice">
|
|
<xs:choice>
|
|
<xs:element name="Cd" type="ExternalPersonIdentification1Code" />
|
|
<xs:element name="Prtry" type="Max35Text" />
|
|
</xs:choice>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="CashAccount38">
|
|
<xs:sequence>
|
|
<xs:element name="Id" type="AccountIdentification4Choice" />
|
|
<xs:element name="Ccy" type="ActiveOrHistoricCurrencyCode" minOccurs="0" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="AccountIdentification4Choice">
|
|
<xs:choice>
|
|
<xs:element name="IBAN" type="IBAN2007Identifier" />
|
|
</xs:choice>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="BranchAndFinancialInstitutionIdentification6">
|
|
<xs:sequence>
|
|
<xs:element name="FinInstnId" type="FinancialInstitutionIdentification18" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="FinancialInstitutionIdentification18">
|
|
<xs:sequence>
|
|
<xs:element name="BICFI" type="BICFIDec2014Identifier" minOccurs="0" />
|
|
<xs:element name="Othr" type="GenericFinancialIdentification1" minOccurs="0" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="GenericFinancialIdentification1">
|
|
<xs:sequence>
|
|
<xs:element name="Id" type="Max35Text" />
|
|
<xs:element name="Issr" type="Max35Text" minOccurs="0" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="ServiceLevel8Choice">
|
|
<xs:choice>
|
|
<xs:element name="Cd" type="ExternalServiceLevel1Code" />
|
|
<xs:element name="Prtry" type="Max35Text" />
|
|
</xs:choice>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="LocalInstrument2Choice">
|
|
<xs:choice>
|
|
<xs:element name="Cd" type="ExternalLocalInstrument1Code" />
|
|
<xs:element name="Prtry" type="Max35Text" />
|
|
</xs:choice>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="RemittanceInformation16">
|
|
<xs:sequence>
|
|
<xs:element name="Ustrd" type="Max140Text" minOccurs="0" maxOccurs="unbounded" />
|
|
</xs:sequence>
|
|
</xs:complexType>
|
|
|
|
<xs:complexType name="ActiveOrHistoricCurrencyAndAmount">
|
|
<xs:simpleContent>
|
|
<xs:extension base="ActiveOrHistoricCurrencyAndAmount_SimpleType">
|
|
<xs:attribute name="Ccy" type="ActiveOrHistoricCurrencyCode" use="required" />
|
|
</xs:extension>
|
|
</xs:simpleContent>
|
|
</xs:complexType>
|
|
|
|
<xs:simpleType name="ActiveOrHistoricCurrencyAndAmount_SimpleType">
|
|
<xs:restriction base="xs:decimal">
|
|
<xs:fractionDigits value="5" />
|
|
<xs:totalDigits value="18" />
|
|
<xs:minInclusive value="0" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="ActiveOrHistoricCurrencyCode">
|
|
<xs:restriction base="xs:string">
|
|
<xs:pattern value="[A-Z]{3,3}" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="DecimalNumber">
|
|
<xs:restriction base="xs:decimal">
|
|
<xs:fractionDigits value="17" />
|
|
<xs:totalDigits value="18" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="Max15NumericText">
|
|
<xs:restriction base="xs:string">
|
|
<xs:pattern value="[0-9]{1,15}" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="BatchBookingIndicator">
|
|
<xs:restriction base="xs:boolean" />
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="PaymentMethod3Code">
|
|
<xs:restriction base="xs:string">
|
|
<xs:enumeration value="CHK" />
|
|
<xs:enumeration value="TRF" />
|
|
<xs:enumeration value="TRA" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="ChargeBearerType1Code">
|
|
<xs:restriction base="xs:string">
|
|
<xs:enumeration value="DEBT" />
|
|
<xs:enumeration value="CRED" />
|
|
<xs:enumeration value="SHAR" />
|
|
<xs:enumeration value="SLEV" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="IBAN2007Identifier">
|
|
<xs:restriction base="xs:string">
|
|
<xs:pattern value="[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="BICFIDec2014Identifier">
|
|
<xs:restriction base="xs:string">
|
|
<xs:pattern value="[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="AnyBICDec2014Identifier">
|
|
<xs:restriction base="xs:string">
|
|
<xs:pattern value="[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="LEIIdentifier">
|
|
<xs:restriction base="xs:string">
|
|
<xs:pattern value="[A-Z0-9]{18,18}[0-9]{2,2}" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="CountryCode">
|
|
<xs:restriction base="xs:string">
|
|
<xs:pattern value="[A-Z]{2,2}" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="ISODate">
|
|
<xs:restriction base="xs:date" />
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="ISODateTime">
|
|
<xs:restriction base="xs:dateTime" />
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="ExternalServiceLevel1Code">
|
|
<xs:restriction base="xs:string">
|
|
<xs:minLength value="1" />
|
|
<xs:maxLength value="4" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="ExternalLocalInstrument1Code">
|
|
<xs:restriction base="xs:string">
|
|
<xs:minLength value="1" />
|
|
<xs:maxLength value="35" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="ExternalOrganisationIdentification1Code">
|
|
<xs:restriction base="xs:string">
|
|
<xs:minLength value="1" />
|
|
<xs:maxLength value="4" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="ExternalPersonIdentification1Code">
|
|
<xs:restriction base="xs:string">
|
|
<xs:minLength value="1" />
|
|
<xs:maxLength value="4" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="Max16Text">
|
|
<xs:restriction base="xs:string">
|
|
<xs:minLength value="1" />
|
|
<xs:maxLength value="16" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="Max35Text">
|
|
<xs:restriction base="xs:string">
|
|
<xs:minLength value="1" />
|
|
<xs:maxLength value="35" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="Max70Text">
|
|
<xs:restriction base="xs:string">
|
|
<xs:minLength value="1" />
|
|
<xs:maxLength value="70" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
<xs:simpleType name="Max140Text">
|
|
<xs:restriction base="xs:string">
|
|
<xs:minLength value="1" />
|
|
<xs:maxLength value="140" />
|
|
</xs:restriction>
|
|
</xs:simpleType>
|
|
|
|
</xs:schema>
|