sepa_king_codeur 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +37 -0
  5. data/CONTRIBUTING.md +38 -0
  6. data/Gemfile +2 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +297 -0
  9. data/Rakefile +6 -0
  10. data/gemfiles/Gemfile-activemodel-3.1.x +5 -0
  11. data/gemfiles/Gemfile-activemodel-3.2.x +5 -0
  12. data/gemfiles/Gemfile-activemodel-4.0.x +5 -0
  13. data/gemfiles/Gemfile-activemodel-4.1.x +5 -0
  14. data/gemfiles/Gemfile-activemodel-4.2.x +5 -0
  15. data/gemfiles/Gemfile-activemodel-5.0.x +5 -0
  16. data/gemfiles/Gemfile-activemodel-5.1.x +5 -0
  17. data/gemfiles/Gemfile-activemodel-5.2.x +5 -0
  18. data/gemfiles/Gemfile-activemodel-6.0.x +5 -0
  19. data/lib/schema/pain.001.001.03.ch.02.xsd +1212 -0
  20. data/lib/schema/pain.001.001.03.xsd +921 -0
  21. data/lib/schema/pain.001.002.03.xsd +450 -0
  22. data/lib/schema/pain.001.003.03.xsd +474 -0
  23. data/lib/schema/pain.008.001.02.xsd +879 -0
  24. data/lib/schema/pain.008.002.02.xsd +597 -0
  25. data/lib/schema/pain.008.003.02.xsd +614 -0
  26. data/lib/sepa_king.rb +19 -0
  27. data/lib/sepa_king/account.rb +19 -0
  28. data/lib/sepa_king/account/creditor_account.rb +8 -0
  29. data/lib/sepa_king/account/creditor_address.rb +37 -0
  30. data/lib/sepa_king/account/debtor_account.rb +5 -0
  31. data/lib/sepa_king/account/debtor_address.rb +37 -0
  32. data/lib/sepa_king/converter.rb +51 -0
  33. data/lib/sepa_king/error.rb +4 -0
  34. data/lib/sepa_king/message.rb +169 -0
  35. data/lib/sepa_king/message/credit_transfer.rb +137 -0
  36. data/lib/sepa_king/message/direct_debit.rb +207 -0
  37. data/lib/sepa_king/transaction.rb +56 -0
  38. data/lib/sepa_king/transaction/credit_transfer_transaction.rb +31 -0
  39. data/lib/sepa_king/transaction/direct_debit_transaction.rb +56 -0
  40. data/lib/sepa_king/validator.rb +57 -0
  41. data/lib/sepa_king/version.rb +3 -0
  42. data/sepa_king.gemspec +33 -0
  43. data/spec/account_spec.rb +42 -0
  44. data/spec/converter_spec.rb +74 -0
  45. data/spec/credit_transfer_spec.rb +520 -0
  46. data/spec/credit_transfer_transaction_spec.rb +74 -0
  47. data/spec/creditor_account_spec.rb +23 -0
  48. data/spec/debtor_account_spec.rb +12 -0
  49. data/spec/debtor_address_spec.rb +12 -0
  50. data/spec/direct_debit_spec.rb +657 -0
  51. data/spec/direct_debit_transaction_spec.rb +69 -0
  52. data/spec/examples/pain.001.001.03.ch.02.xml +172 -0
  53. data/spec/examples/pain.001.001.03.xml +89 -0
  54. data/spec/examples/pain.001.002.03.xml +89 -0
  55. data/spec/examples/pain.001.003.03.xml +89 -0
  56. data/spec/examples/pain.008.002.02.xml +134 -0
  57. data/spec/examples/pain.008.003.02.xml +134 -0
  58. data/spec/message_spec.rb +128 -0
  59. data/spec/spec_helper.rb +33 -0
  60. data/spec/support/active_model.rb +30 -0
  61. data/spec/support/custom_matcher.rb +60 -0
  62. data/spec/support/factories.rb +24 -0
  63. data/spec/support/validations.rb +27 -0
  64. data/spec/transaction_spec.rb +134 -0
  65. data/spec/validation_spec.rb +25 -0
  66. data/spec/validator_spec.rb +99 -0
  67. metadata +250 -0
@@ -0,0 +1,614 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Mit XMLSpy v2008 rel. 2 (http://www.altova.com) von Wenzel (SIZ Bonn) bearbeitet -->
3
+ <!-- Version gemäß DFÜ-Abkommen Anlage 3, Version 2.7, gültig ab November 2013 mit Umsetzung von IBAN Only gemäß EPC SDD Core IG 7.0 bzw. SDD B2B IG 5.0 , zudem Einbau der COR1-Option durch Erweiterung Local Instrument und Erweiterung Service Level auf Externe Codeliste-->
4
+ <!-- Mit XMLSpy v2008 rel. 2 sp2 (http://www.altova.com) am 29.11.2012 von der SIZ GmbH bearbeitet -->
5
+ <xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.003.02" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.008.003.02" elementFormDefault="qualified">
6
+ <xs:element name="Document" type="Document"/>
7
+ <xs:complexType name="AccountIdentificationSEPA">
8
+ <xs:sequence>
9
+ <xs:element name="IBAN" type="IBAN2007Identifier"/>
10
+ </xs:sequence>
11
+ </xs:complexType>
12
+ <xs:simpleType name="ActiveOrHistoricCurrencyAndAmount_SimpleTypeSEPA">
13
+ <xs:restriction base="xs:decimal">
14
+ <xs:minInclusive value="0.01"/>
15
+ <xs:maxInclusive value="999999999.99"/>
16
+ <xs:fractionDigits value="2"/>
17
+ <xs:totalDigits value="11"/>
18
+ </xs:restriction>
19
+ </xs:simpleType>
20
+ <xs:complexType name="ActiveOrHistoricCurrencyAndAmountSEPA">
21
+ <xs:simpleContent>
22
+ <xs:extension base="ActiveOrHistoricCurrencyAndAmount_SimpleTypeSEPA">
23
+ <xs:attribute name="Ccy" type="ActiveOrHistoricCurrencyCodeEUR" use="required"/>
24
+ </xs:extension>
25
+ </xs:simpleContent>
26
+ </xs:complexType>
27
+ <xs:simpleType name="ActiveOrHistoricCurrencyCodeEUR">
28
+ <xs:restriction base="xs:string">
29
+ <xs:enumeration value="EUR"/>
30
+ </xs:restriction>
31
+ </xs:simpleType>
32
+ <xs:simpleType name="ActiveOrHistoricCurrencyCode">
33
+ <xs:restriction base="xs:string">
34
+ <xs:pattern value="[A-Z]{3,3}"/>
35
+ </xs:restriction>
36
+ </xs:simpleType>
37
+ <xs:complexType name="AmendmentInformationDetailsSDD">
38
+ <xs:sequence>
39
+ <xs:element name="OrgnlMndtId" type="RestrictedIdentificationSEPA2" minOccurs="0">
40
+ <xs:annotation>
41
+ <xs:documentation>Mandatory if changes occur in ‘Mandate Identification’, otherwise not to be used.</xs:documentation>
42
+ </xs:annotation>
43
+ </xs:element>
44
+ <xs:element name="OrgnlCdtrSchmeId" type="PartyIdentificationSEPA4" minOccurs="0">
45
+ <xs:annotation>
46
+ <xs:documentation>Mandatory if changes occur in 'Creditor Scheme Identification', otherwise not to be used.</xs:documentation>
47
+ </xs:annotation>
48
+ </xs:element>
49
+ <xs:element name="OrgnlDbtrAcct" type="CashAccountSEPA2" minOccurs="0">
50
+ <xs:annotation>
51
+ <xs:documentation>To be used only for changes of accounts within the same bank.</xs:documentation>
52
+ </xs:annotation>
53
+ </xs:element>
54
+ <xs:element name="OrgnlDbtrAgt" type="BranchAndFinancialInstitutionIdentificationSEPA2" minOccurs="0">
55
+ <xs:annotation>
56
+ <xs:documentation>To use 'Identification’ under 'Other' under 'Financial Institution Identifier with code ‘SMNDA’ to indicate same mandate with new Debtor Agent. To be used with the ‘FRST’ indicator in the ‘Sequence Type’.</xs:documentation>
57
+ </xs:annotation>
58
+ </xs:element>
59
+ </xs:sequence>
60
+ </xs:complexType>
61
+ <xs:simpleType name="AnyBICIdentifier">
62
+ <xs:restriction base="xs:string">
63
+ <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
64
+ </xs:restriction>
65
+ </xs:simpleType>
66
+ <xs:simpleType name="BICIdentifier">
67
+ <xs:restriction base="xs:string">
68
+ <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
69
+ </xs:restriction>
70
+ </xs:simpleType>
71
+ <xs:simpleType name="BatchBookingIndicator">
72
+ <xs:restriction base="xs:boolean"/>
73
+ </xs:simpleType>
74
+ <xs:complexType name="BranchAndFinancialInstitutionIdentificationSEPA3">
75
+ <xs:sequence>
76
+ <xs:element name="FinInstnId" type="FinancialInstitutionIdentificationSEPA3"/>
77
+ </xs:sequence>
78
+ </xs:complexType>
79
+ <xs:complexType name="BranchAndFinancialInstitutionIdentificationSEPA2">
80
+ <xs:sequence>
81
+ <xs:element name="FinInstnId" type="FinancialInstitutionIdentificationSEPA2"/>
82
+ </xs:sequence>
83
+ </xs:complexType>
84
+ <xs:complexType name="CashAccountSEPA1">
85
+ <xs:sequence>
86
+ <xs:element name="Id" type="AccountIdentificationSEPA"/>
87
+ <xs:element name="Ccy" type="ActiveOrHistoricCurrencyCode" minOccurs="0"/>
88
+ </xs:sequence>
89
+ </xs:complexType>
90
+ <xs:complexType name="CashAccountSEPA2">
91
+ <xs:sequence>
92
+ <xs:element name="Id" type="AccountIdentificationSEPA"/>
93
+ </xs:sequence>
94
+ </xs:complexType>
95
+ <xs:complexType name="CategoryPurposeSEPA">
96
+ <xs:sequence>
97
+ <xs:element name="Cd" type="ExternalCategoryPurpose1Code"/>
98
+ </xs:sequence>
99
+ </xs:complexType>
100
+ <xs:simpleType name="ChargeBearerTypeSEPACode">
101
+ <xs:restriction base="xs:string">
102
+ <xs:enumeration value="SLEV"/>
103
+ </xs:restriction>
104
+ </xs:simpleType>
105
+ <xs:simpleType name="CountryCode">
106
+ <xs:restriction base="xs:string">
107
+ <xs:pattern value="[A-Z]{2,2}"/>
108
+ </xs:restriction>
109
+ </xs:simpleType>
110
+ <xs:complexType name="CreditorReferenceInformationSEPA1">
111
+ <xs:sequence>
112
+ <xs:element name="Tp" type="CreditorReferenceTypeSEPA"/>
113
+ <xs:element name="Ref" type="Max35Text">
114
+ <xs:annotation>
115
+ <xs:documentation>If a Creditor Reference contains a check digit, the receiving bank is not required to validate this.
116
+ If the receiving bank validates the check digit and if this validation fails, the bank may continue its processing and send the transaction to the next party in the chain.</xs:documentation>
117
+ </xs:annotation>
118
+ </xs:element>
119
+ </xs:sequence>
120
+ </xs:complexType>
121
+ <xs:complexType name="CreditorReferenceTypeSEPA">
122
+ <xs:sequence>
123
+ <xs:element name="CdOrPrtry" type="CreditorReferenceTypeCodeSEPA"/>
124
+ <xs:element name="Issr" type="Max35Text" minOccurs="0"/>
125
+ </xs:sequence>
126
+ </xs:complexType>
127
+ <xs:complexType name="CreditorReferenceTypeCodeSEPA">
128
+ <xs:sequence>
129
+ <xs:element name="Cd" type="DocumentType3CodeSEPA"/>
130
+ </xs:sequence>
131
+ </xs:complexType>
132
+ <xs:complexType name="CustomerDirectDebitInitiationV02">
133
+ <xs:sequence>
134
+ <xs:element name="GrpHdr" type="GroupHeaderSDD"/>
135
+ <xs:element name="PmtInf" type="PaymentInstructionInformationSDD" maxOccurs="unbounded"/>
136
+ </xs:sequence>
137
+ </xs:complexType>
138
+ <xs:complexType name="DateAndPlaceOfBirth">
139
+ <xs:sequence>
140
+ <xs:element name="BirthDt" type="ISODate"/>
141
+ <xs:element name="PrvcOfBirth" type="Max35Text" minOccurs="0"/>
142
+ <xs:element name="CityOfBirth" type="Max35Text"/>
143
+ <xs:element name="CtryOfBirth" type="CountryCode"/>
144
+ </xs:sequence>
145
+ </xs:complexType>
146
+ <xs:simpleType name="DecimalNumber">
147
+ <xs:restriction base="xs:decimal">
148
+ <xs:fractionDigits value="17"/>
149
+ <xs:totalDigits value="18"/>
150
+ </xs:restriction>
151
+ </xs:simpleType>
152
+ <xs:complexType name="DirectDebitTransactionSDD">
153
+ <xs:sequence>
154
+ <xs:element name="MndtRltdInf" type="MandateRelatedInformationSDD"/>
155
+ <xs:element name="CdtrSchmeId" type="PartyIdentificationSEPA3" minOccurs="0">
156
+ <xs:annotation>
157
+ <xs:documentation>It is recommended that all transactions within the same ‘Payment Information’ block have the same ‘Creditor Scheme Identification’.
158
+ This data element must be present at either ‘Payment Information’ or ‘Direct Debit
159
+ Transaction’ level.</xs:documentation>
160
+ </xs:annotation>
161
+ </xs:element>
162
+ </xs:sequence>
163
+ </xs:complexType>
164
+ <xs:complexType name="DirectDebitTransactionInformationSDD">
165
+ <xs:sequence>
166
+ <xs:element name="PmtId" type="PaymentIdentificationSEPA"/>
167
+ <xs:element name="InstdAmt" type="ActiveOrHistoricCurrencyAndAmountSEPA"/>
168
+ <xs:element name="ChrgBr" type="ChargeBearerTypeSEPACode" minOccurs="0">
169
+ <xs:annotation>
170
+ <xs:documentation>It is recommended that this element be specified at ‘Payment Information’ level.</xs:documentation>
171
+ </xs:annotation>
172
+ </xs:element>
173
+ <xs:element name="DrctDbtTx" type="DirectDebitTransactionSDD"/>
174
+ <xs:element name="UltmtCdtr" type="PartyIdentificationSEPA1" minOccurs="0">
175
+ <xs:annotation>
176
+ <xs:documentation>This data element may be present either at ‘Payment Information’ or at ‘Direct Debit Transaction Information’ level.</xs:documentation>
177
+ </xs:annotation>
178
+ </xs:element>
179
+ <xs:element name="DbtrAgt" type="BranchAndFinancialInstitutionIdentificationSEPA3"/>
180
+ <xs:element name="Dbtr" type="PartyIdentificationSEPA2"/>
181
+ <xs:element name="DbtrAcct" type="CashAccountSEPA2"/>
182
+ <xs:element name="UltmtDbtr" type="PartyIdentificationSEPA1" minOccurs="0">
183
+ <xs:annotation>
184
+ <xs:documentation>Mandatory if provided by the debtor in the mandate.</xs:documentation>
185
+ </xs:annotation>
186
+ </xs:element>
187
+ <xs:element name="Purp" type="PurposeSEPA" minOccurs="0"/>
188
+ <xs:element name="RmtInf" type="RemittanceInformationSEPA1Choice" minOccurs="0"/>
189
+ </xs:sequence>
190
+ </xs:complexType>
191
+ <xs:complexType name="Document">
192
+ <xs:sequence>
193
+ <xs:element name="CstmrDrctDbtInitn" type="CustomerDirectDebitInitiationV02"/>
194
+ </xs:sequence>
195
+ </xs:complexType>
196
+ <xs:simpleType name="DocumentType3CodeSEPA">
197
+ <xs:restriction base="xs:string">
198
+ <xs:enumeration value="SCOR"/>
199
+ </xs:restriction>
200
+ </xs:simpleType>
201
+ <xs:simpleType name="ExternalCategoryPurpose1Code">
202
+ <xs:restriction base="xs:string">
203
+ <xs:minLength value="1"/>
204
+ <xs:maxLength value="4"/>
205
+ </xs:restriction>
206
+ </xs:simpleType>
207
+ <xs:simpleType name="ExternalLocalInstrument1Code">
208
+ <xs:restriction base="xs:string">
209
+ <xs:minLength value="1"/>
210
+ <xs:maxLength value="35"/>
211
+ </xs:restriction>
212
+ </xs:simpleType>
213
+ <xs:simpleType name="ExternalOrganisationIdentification1Code">
214
+ <xs:restriction base="xs:string">
215
+ <xs:minLength value="1"/>
216
+ <xs:maxLength value="4"/>
217
+ </xs:restriction>
218
+ </xs:simpleType>
219
+ <xs:simpleType name="ExternalPersonIdentification1Code">
220
+ <xs:restriction base="xs:string">
221
+ <xs:minLength value="1"/>
222
+ <xs:maxLength value="4"/>
223
+ </xs:restriction>
224
+ </xs:simpleType>
225
+ <xs:simpleType name="ExternalPurpose1Code">
226
+ <xs:restriction base="xs:string">
227
+ <xs:minLength value="1"/>
228
+ <xs:maxLength value="4"/>
229
+ </xs:restriction>
230
+ </xs:simpleType>
231
+ <xs:simpleType name="ExternalServiceLevel1Code">
232
+ <xs:restriction base="xs:string">
233
+ <xs:minLength value="1"/>
234
+ <xs:maxLength value="4"/>
235
+ </xs:restriction>
236
+ </xs:simpleType>
237
+ <xs:complexType name="FinancialInstitutionIdentificationSEPA3">
238
+ <xs:sequence>
239
+ <xs:choice>
240
+ <xs:element name="BIC" type="BICIdentifier"/>
241
+ <xs:element name="Othr" type="OthrIdentification"/>
242
+ </xs:choice>
243
+ </xs:sequence>
244
+ </xs:complexType>
245
+ <xs:complexType name="OthrIdentification">
246
+ <xs:sequence>
247
+ <xs:element name="Id" type="OthrIdentificationCode"/>
248
+ </xs:sequence>
249
+ </xs:complexType>
250
+ <xs:simpleType name="OthrIdentificationCode">
251
+ <xs:restriction base="xs:string">
252
+ <xs:enumeration value="NOTPROVIDED"/>
253
+ </xs:restriction>
254
+ </xs:simpleType>
255
+ <xs:complexType name="FinancialInstitutionIdentificationSEPA2">
256
+ <xs:sequence>
257
+ <xs:element name="Othr" type="RestrictedFinancialIdentificationSEPA"/>
258
+ </xs:sequence>
259
+ </xs:complexType>
260
+ <xs:complexType name="RestrictedFinancialIdentificationSEPA">
261
+ <xs:sequence>
262
+ <xs:element name="Id" type="RestrictedSMNDACode"/>
263
+ </xs:sequence>
264
+ </xs:complexType>
265
+ <xs:simpleType name="RestrictedSMNDACode">
266
+ <xs:restriction base="xs:string">
267
+ <xs:enumeration value="SMNDA"/>
268
+ </xs:restriction>
269
+ </xs:simpleType>
270
+ <xs:complexType name="GenericOrganisationIdentification1">
271
+ <xs:sequence>
272
+ <xs:element name="Id" type="Max35Text"/>
273
+ <xs:element name="SchmeNm" type="OrganisationIdentificationSchemeName1Choice" minOccurs="0"/>
274
+ <xs:element name="Issr" type="Max35Text" minOccurs="0"/>
275
+ </xs:sequence>
276
+ </xs:complexType>
277
+ <xs:complexType name="GenericPersonIdentification1">
278
+ <xs:sequence>
279
+ <xs:element name="Id" type="Max35Text"/>
280
+ <xs:element name="SchmeNm" type="PersonIdentificationSchemeName1Choice" minOccurs="0"/>
281
+ <xs:element name="Issr" type="Max35Text" minOccurs="0"/>
282
+ </xs:sequence>
283
+ </xs:complexType>
284
+ <xs:complexType name="RestrictedPersonIdentificationSEPA">
285
+ <xs:sequence>
286
+ <xs:element name="Id" type="RestrictedPersonIdentifierSEPA"/>
287
+ <xs:element name="SchmeNm" type="RestrictedPersonIdentificationSchemeNameSEPA"/>
288
+ </xs:sequence>
289
+ </xs:complexType>
290
+ <xs:simpleType name="RestrictedPersonIdentifierSEPA">
291
+ <xs:restriction base="xs:string">
292
+ <xs:pattern value="[a-zA-Z]{2,2}[0-9]{2,2}([A-Za-z0-9]|[\+|\?|/|\-|:|\(|\)|\.|,|']){3,3}([A-Za-z0-9]|[\+|\?|/|\-|:|\(|\)|\.|,|']){1,28}"/>
293
+ </xs:restriction>
294
+ </xs:simpleType>
295
+ <xs:complexType name="GroupHeaderSDD">
296
+ <xs:sequence>
297
+ <xs:element name="MsgId" type="RestrictedIdentificationSEPA1"/>
298
+ <xs:element name="CreDtTm" type="ISODateTime"/>
299
+ <xs:element name="NbOfTxs" type="Max15NumericText"/>
300
+ <xs:element name="CtrlSum" type="DecimalNumber" minOccurs="0"/>
301
+ <xs:element name="InitgPty" type="PartyIdentificationSEPA1"/>
302
+ </xs:sequence>
303
+ </xs:complexType>
304
+ <xs:simpleType name="IBAN2007Identifier">
305
+ <xs:restriction base="xs:string">
306
+ <xs:pattern value="[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"/>
307
+ </xs:restriction>
308
+ </xs:simpleType>
309
+ <xs:simpleType name="ISODate">
310
+ <xs:restriction base="xs:date"/>
311
+ </xs:simpleType>
312
+ <xs:simpleType name="ISODateTime">
313
+ <xs:restriction base="xs:dateTime"/>
314
+ </xs:simpleType>
315
+ <xs:complexType name="LocalInstrumentSEPA">
316
+ <xs:sequence>
317
+ <xs:element name="Cd" type="ExternalLocalInstrument1Code"/>
318
+ </xs:sequence>
319
+ </xs:complexType>
320
+ <xs:complexType name="MandateRelatedInformationSDD">
321
+ <xs:sequence>
322
+ <xs:element name="MndtId" type="RestrictedIdentificationSEPA2"/>
323
+ <xs:element name="DtOfSgntr" type="ISODate"/>
324
+ <xs:element name="AmdmntInd" type="TrueFalseIndicator" minOccurs="0"/>
325
+ <xs:element name="AmdmntInfDtls" type="AmendmentInformationDetailsSDD" minOccurs="0">
326
+ <xs:annotation>
327
+ <xs:documentation>Mandatory if 'Amendment Indicator' is 'TRUE'
328
+ The reason code from the Rulebook is indicated using one of the following message subelements.</xs:documentation>
329
+ </xs:annotation>
330
+ </xs:element>
331
+ <xs:element name="ElctrncSgntr" type="Max1025Text" minOccurs="0"/>
332
+ </xs:sequence>
333
+ </xs:complexType>
334
+ <xs:simpleType name="Max1025Text">
335
+ <xs:restriction base="xs:string">
336
+ <xs:minLength value="1"/>
337
+ <xs:maxLength value="1025"/>
338
+ </xs:restriction>
339
+ </xs:simpleType>
340
+ <xs:simpleType name="Max140Text">
341
+ <xs:restriction base="xs:string">
342
+ <xs:minLength value="1"/>
343
+ <xs:maxLength value="140"/>
344
+ </xs:restriction>
345
+ </xs:simpleType>
346
+ <xs:simpleType name="Max15NumericText">
347
+ <xs:restriction base="xs:string">
348
+ <xs:pattern value="[0-9]{1,15}"/>
349
+ </xs:restriction>
350
+ </xs:simpleType>
351
+ <xs:simpleType name="Max35Text">
352
+ <xs:restriction base="xs:string">
353
+ <xs:minLength value="1"/>
354
+ <xs:maxLength value="35"/>
355
+ </xs:restriction>
356
+ </xs:simpleType>
357
+ <xs:simpleType name="Max70Text">
358
+ <xs:restriction base="xs:string">
359
+ <xs:minLength value="1"/>
360
+ <xs:maxLength value="70"/>
361
+ </xs:restriction>
362
+ </xs:simpleType>
363
+ <xs:complexType name="OrganisationIdentificationSEPAChoice">
364
+ <xs:sequence>
365
+ <xs:choice>
366
+ <xs:element name="BICOrBEI" type="AnyBICIdentifier"/>
367
+ <xs:element name="Othr" type="GenericOrganisationIdentification1"/>
368
+ </xs:choice>
369
+ </xs:sequence>
370
+ </xs:complexType>
371
+ <xs:complexType name="OrganisationIdentificationSchemeName1Choice">
372
+ <xs:sequence>
373
+ <xs:choice>
374
+ <xs:element name="Cd" type="ExternalOrganisationIdentification1Code"/>
375
+ <xs:element name="Prtry" type="Max35Text"/>
376
+ </xs:choice>
377
+ </xs:sequence>
378
+ </xs:complexType>
379
+ <xs:complexType name="PartySEPAChoice">
380
+ <xs:sequence>
381
+ <xs:choice>
382
+ <xs:element name="OrgId" type="OrganisationIdentificationSEPAChoice">
383
+ <xs:annotation>
384
+ <xs:documentation>Either ‘BIC or BEI’ or one
385
+ occurrence of ‘Other’ is allowed.</xs:documentation>
386
+ </xs:annotation>
387
+ </xs:element>
388
+ <xs:element name="PrvtId" type="PersonIdentificationSEPA1Choice">
389
+ <xs:annotation>
390
+ <xs:documentation>Either ‘Date and Place of Birth’ or one occurrence of ‘Other’ is allowed</xs:documentation>
391
+ </xs:annotation>
392
+ </xs:element>
393
+ </xs:choice>
394
+ </xs:sequence>
395
+ </xs:complexType>
396
+ <xs:complexType name="PartySEPA2">
397
+ <xs:sequence>
398
+ <xs:element name="PrvtId" type="PersonIdentificationSEPA2">
399
+ <xs:annotation>
400
+ <xs:documentation>Private Identification is used to identify either an organisation or a private
401
+ person.</xs:documentation>
402
+ </xs:annotation>
403
+ </xs:element>
404
+ </xs:sequence>
405
+ </xs:complexType>
406
+ <xs:complexType name="PartyIdentificationSEPA1">
407
+ <xs:sequence>
408
+ <xs:element name="Nm" type="Max70Text" minOccurs="0">
409
+ <xs:annotation>
410
+ <xs:documentation>‘Name’ is limited to 70 characters in length.</xs:documentation>
411
+ </xs:annotation>
412
+ </xs:element>
413
+ <xs:element name="Id" type="PartySEPAChoice" minOccurs="0"/>
414
+ </xs:sequence>
415
+ </xs:complexType>
416
+ <xs:complexType name="PartyIdentificationSEPA2">
417
+ <xs:sequence>
418
+ <xs:element name="Nm" type="Max70Text">
419
+ <xs:annotation>
420
+ <xs:documentation>‘Name’ is limited to 70 characters in length.</xs:documentation>
421
+ </xs:annotation>
422
+ </xs:element>
423
+ <xs:element name="PstlAdr" type="PostalAddressSEPA" minOccurs="0"/>
424
+ <xs:element name="Id" type="PartySEPAChoice" minOccurs="0"/>
425
+ </xs:sequence>
426
+ </xs:complexType>
427
+ <xs:complexType name="PartyIdentificationSEPA3">
428
+ <xs:sequence>
429
+ <xs:element name="Id" type="PartySEPA2"/>
430
+ </xs:sequence>
431
+ </xs:complexType>
432
+ <xs:complexType name="PartyIdentificationSEPA4">
433
+ <xs:sequence>
434
+ <xs:element name="Nm" type="Max70Text" minOccurs="0">
435
+ <xs:annotation>
436
+ <xs:documentation>If present the new’ Name’ must be specified under ‘Creditor’. ‘Name’ is limited to 70 characters in length.</xs:documentation>
437
+ </xs:annotation>
438
+ </xs:element>
439
+ <xs:element name="Id" type="PartySEPA2" minOccurs="0"/>
440
+ </xs:sequence>
441
+ </xs:complexType>
442
+ <xs:complexType name="PartyIdentificationSEPA5">
443
+ <xs:sequence>
444
+ <xs:element name="Nm" type="Max70Text">
445
+ <xs:annotation>
446
+ <xs:documentation>‘Name’ is limited to 70 characters in length.</xs:documentation>
447
+ </xs:annotation>
448
+ </xs:element>
449
+ <xs:element name="PstlAdr" type="PostalAddressSEPA" minOccurs="0"/>
450
+ </xs:sequence>
451
+ </xs:complexType>
452
+ <xs:complexType name="PaymentIdentificationSEPA">
453
+ <xs:sequence>
454
+ <xs:element name="InstrId" type="RestrictedIdentificationSEPA1" minOccurs="0"/>
455
+ <xs:element name="EndToEndId" type="RestrictedIdentificationSEPA1"/>
456
+ </xs:sequence>
457
+ </xs:complexType>
458
+ <xs:complexType name="PaymentInstructionInformationSDD">
459
+ <xs:sequence>
460
+ <xs:element name="PmtInfId" type="RestrictedIdentificationSEPA1"/>
461
+ <xs:element name="PmtMtd" type="PaymentMethod2Code"/>
462
+ <xs:element name="BtchBookg" type="BatchBookingIndicator" minOccurs="0">
463
+ <xs:annotation>
464
+ <xs:documentation>If present and contains ‘true’, batch booking is requested. If present and contains ‘false’, booking per transaction is requested. If element is not present, pre-agreed customer-to-bank conditions apply.</xs:documentation>
465
+ </xs:annotation>
466
+ </xs:element>
467
+ <xs:element name="NbOfTxs" type="Max15NumericText" minOccurs="0"/>
468
+ <xs:element name="CtrlSum" type="DecimalNumber" minOccurs="0"/>
469
+ <xs:element name="PmtTpInf" type="PaymentTypeInformationSDD"/>
470
+ <xs:element name="ReqdColltnDt" type="ISODate"/>
471
+ <xs:element name="Cdtr" type="PartyIdentificationSEPA5"/>
472
+ <xs:element name="CdtrAcct" type="CashAccountSEPA1"/>
473
+ <xs:element name="CdtrAgt" type="BranchAndFinancialInstitutionIdentificationSEPA3"/>
474
+ <xs:element name="UltmtCdtr" type="PartyIdentificationSEPA1" minOccurs="0">
475
+ <xs:annotation>
476
+ <xs:documentation>This data element may be present either at ‘Payment Information’ or at ‘Direct Debit Transaction Information’ level.</xs:documentation>
477
+ </xs:annotation>
478
+ </xs:element>
479
+ <xs:element name="ChrgBr" type="ChargeBearerTypeSEPACode" minOccurs="0">
480
+ <xs:annotation>
481
+ <xs:documentation>It is recommended that this element be specified at ‘Payment Information’ level.</xs:documentation>
482
+ </xs:annotation>
483
+ </xs:element>
484
+ <xs:element name="CdtrSchmeId" type="PartyIdentificationSEPA3" minOccurs="0">
485
+ <xs:annotation>
486
+ <xs:documentation>It is recommended that all transactions within the same ‘Payment Information’ block have the same ‘Creditor Scheme Identification’.
487
+ This data element must be present at either ‘Payment Information’ or ‘Direct Debit
488
+ Transaction’ level.</xs:documentation>
489
+ </xs:annotation>
490
+ </xs:element>
491
+ <xs:element name="DrctDbtTxInf" type="DirectDebitTransactionInformationSDD" maxOccurs="unbounded"/>
492
+ </xs:sequence>
493
+ </xs:complexType>
494
+ <xs:simpleType name="PaymentMethod2Code">
495
+ <xs:restriction base="xs:string">
496
+ <xs:enumeration value="DD"/>
497
+ </xs:restriction>
498
+ </xs:simpleType>
499
+ <xs:complexType name="PaymentTypeInformationSDD">
500
+ <xs:sequence>
501
+ <xs:element name="SvcLvl" type="ServiceLevelSEPA"/>
502
+ <xs:element name="LclInstrm" type="LocalInstrumentSEPA">
503
+ <xs:annotation>
504
+ <xs:documentation>Only ‘B2B’, 'CORE' or 'COR1' is allowed. The mixing of different Local Instrument values is not allowed in the same message.</xs:documentation>
505
+ </xs:annotation>
506
+ </xs:element>
507
+ <xs:element name="SeqTp" type="SequenceType1Code">
508
+ <xs:annotation>
509
+ <xs:documentation>If 'Amendment Indicator' is 'true' and 'Original Debtor Agent' is set to 'SMNDA' this message element must indicate 'FRST'</xs:documentation>
510
+ </xs:annotation>
511
+ </xs:element>
512
+ <xs:element name="CtgyPurp" type="CategoryPurposeSEPA" minOccurs="0">
513
+ <xs:annotation>
514
+ <xs:documentation>Depending on the agreement between the Creditor and the Creditor Bank, ‘Category Purpose’ may be forwarded to the Debtor Bank.</xs:documentation>
515
+ </xs:annotation>
516
+ </xs:element>
517
+ </xs:sequence>
518
+ </xs:complexType>
519
+ <xs:complexType name="PersonIdentificationSEPA1Choice">
520
+ <xs:sequence>
521
+ <xs:choice>
522
+ <xs:element name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth"/>
523
+ <xs:element name="Othr" type="GenericPersonIdentification1"/>
524
+ </xs:choice>
525
+ </xs:sequence>
526
+ </xs:complexType>
527
+ <xs:complexType name="PersonIdentificationSEPA2">
528
+ <xs:sequence>
529
+ <xs:element name="Othr" type="RestrictedPersonIdentificationSEPA">
530
+ <xs:annotation>
531
+ <xs:documentation>Only one occurrence of ‘Other’ is allowed, and no other sub-elements are allowed.
532
+ Identification must be used with an identifier described in General Message Element Specifications, Chapter 1.5.2 of the Implementation Guide.
533
+ Scheme Name’ under ‘Other’ must specify ‘SEPA’ under ‘Proprietary</xs:documentation>
534
+ </xs:annotation>
535
+ </xs:element>
536
+ </xs:sequence>
537
+ </xs:complexType>
538
+ <xs:complexType name="PersonIdentificationSchemeName1Choice">
539
+ <xs:sequence>
540
+ <xs:choice>
541
+ <xs:element name="Cd" type="ExternalPersonIdentification1Code"/>
542
+ <xs:element name="Prtry" type="Max35Text"/>
543
+ </xs:choice>
544
+ </xs:sequence>
545
+ </xs:complexType>
546
+ <xs:complexType name="RestrictedPersonIdentificationSchemeNameSEPA">
547
+ <xs:sequence>
548
+ <xs:element name="Prtry" type="IdentificationSchemeNameSEPA"/>
549
+ </xs:sequence>
550
+ </xs:complexType>
551
+ <xs:simpleType name="IdentificationSchemeNameSEPA">
552
+ <xs:restriction base="xs:string">
553
+ <xs:enumeration value="SEPA"/>
554
+ </xs:restriction>
555
+ </xs:simpleType>
556
+ <xs:complexType name="PostalAddressSEPA">
557
+ <xs:sequence>
558
+ <xs:element name="Ctry" type="CountryCode" minOccurs="0"/>
559
+ <xs:element name="AdrLine" type="Max70Text" minOccurs="0" maxOccurs="2"/>
560
+ </xs:sequence>
561
+ </xs:complexType>
562
+ <xs:complexType name="PurposeSEPA">
563
+ <xs:sequence>
564
+ <xs:element name="Cd" type="ExternalPurpose1Code">
565
+ <xs:annotation>
566
+ <xs:documentation>Only codes from the ISO 20022 ExternalPurposeCode list are allowed.</xs:documentation>
567
+ </xs:annotation>
568
+ </xs:element>
569
+ </xs:sequence>
570
+ </xs:complexType>
571
+ <xs:complexType name="RemittanceInformationSEPA1Choice">
572
+ <xs:sequence>
573
+ <xs:choice>
574
+ <xs:element name="Ustrd" type="Max140Text"/>
575
+ <xs:element name="Strd" type="StructuredRemittanceInformationSEPA1"/>
576
+ </xs:choice>
577
+ </xs:sequence>
578
+ </xs:complexType>
579
+ <xs:simpleType name="SequenceType1Code">
580
+ <xs:restriction base="xs:string">
581
+ <xs:enumeration value="FRST"/>
582
+ <xs:enumeration value="RCUR"/>
583
+ <xs:enumeration value="FNAL"/>
584
+ <xs:enumeration value="OOFF"/>
585
+ </xs:restriction>
586
+ </xs:simpleType>
587
+ <xs:complexType name="ServiceLevelSEPA">
588
+ <xs:sequence>
589
+ <xs:element name="Cd" type="ExternalServiceLevel1Code"/>
590
+ </xs:sequence>
591
+ </xs:complexType>
592
+ <xs:complexType name="StructuredRemittanceInformationSEPA1">
593
+ <xs:sequence>
594
+ <xs:element name="CdtrRefInf" type="CreditorReferenceInformationSEPA1" minOccurs="0">
595
+ <xs:annotation>
596
+ <xs:documentation>When present, the receiving bank is not obliged to validate the reference information.</xs:documentation>
597
+ </xs:annotation>
598
+ </xs:element>
599
+ </xs:sequence>
600
+ </xs:complexType>
601
+ <xs:simpleType name="TrueFalseIndicator">
602
+ <xs:restriction base="xs:boolean"/>
603
+ </xs:simpleType>
604
+ <xs:simpleType name="RestrictedIdentificationSEPA1">
605
+ <xs:restriction base="xs:string">
606
+ <xs:pattern value="([A-Za-z0-9]|[\+|\?|/|\-|:|\(|\)|\.|,|'| ]){1,35}"/>
607
+ </xs:restriction>
608
+ </xs:simpleType>
609
+ <xs:simpleType name="RestrictedIdentificationSEPA2">
610
+ <xs:restriction base="xs:string">
611
+ <xs:pattern value="([A-Za-z0-9]|[\+|\?|/|\-|:|\(|\)|\.|,|']){1,35}"/>
612
+ </xs:restriction>
613
+ </xs:simpleType>
614
+ </xs:schema>