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