3-D Secure Schema

The 3-D Secure schema is created based on the official 3-D Secure DTD found in the 3-D Secure protocol specification from VISA.

It contains the parts used and supported by the 3DS Server.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
<?xml version="1.0" encoding="UTF-8"?>
  elementFormDefault="unqualified" attributeFormDefault="unqualified">
  <!-- This schema definition is created from Visa's DTD for 3-D Secure Messages, Version 1.0.2 -->
 
  <xs:element name="ThreeDSecure" type="ThreeDSecureType" />
 
  <xs:complexType name="ThreeDSecureType">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          3-D Secure message container.
        ]]>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Message" type="Message" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
 
  <xs:complexType name="Message">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          3-D Secure message.
           
          Contains protocol defined messages for VEReq, VERes, PAReq, PARes and Error.
           
          In addition to the ThreeDSecure protocol defined elements,
          this scheme allows any unknown child elements of Message to be unmarshalled into DOM nodes.
           
          This is done for two reasons:
          - unmarshalling of Signature element, created when message is digitally signed
          - unmarshalling of other unknown elements, sent by VISA CTH testing suite
        ]]>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:choice>
        <xs:element ref="VEReq" />
        <xs:element ref="VERes" />
        <xs:element ref="PAReq" />
        <xs:element ref="PARes" />
        <xs:element name="Error" type="Error" />
      </xs:choice>
      <xs:any maxOccurs="unbounded" minOccurs="0" />
    </xs:sequence>
    <xs:attribute name="id" use="required" type="xs:string" />
  </xs:complexType>
 
  <!-- Message types -->
 
  <xs:element name="VEReq">
    <xs:complexType>
      <xs:annotation>
        <xs:documentation>
          <![CDATA[
            Verify Enrollment Request.
          ]]>
        </xs:documentation>
      </xs:annotation>
      <xs:sequence>
        <xs:element name="version" type="xs:string">
          <xs:annotation>
            <xs:documentation>
              <![CDATA[
                3-D Secure protocol version identifier (should always be 1.0.2).
              ]]>
            </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="pan" type="xs:string" />
        <xs:element name="Merchant" type="Merchant" />
        <xs:element name="Browser" type="Browser" minOccurs="0" />
        <xs:element name="Extension" type="xs:anyType" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>
              <![CDATA[
                Message Extension: Requirements may emerge that cannot be supported by elements in the 3-D Secure messages;
                any data necessary to support these requirements must be carried in a message extension.
 
                Every extension is required to have an 'id' attribute and a 'critical' (true/false) attribute.
              ]]>
            </xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
 
  <xs:element name="VERes">
    <xs:complexType>
      <xs:annotation>
        <xs:documentation>
          <![CDATA[
            Verify Enrollment Response.
          ]]>
        </xs:documentation>
      </xs:annotation>
      <xs:sequence>
        <xs:element name="version" type="xs:string">
          <xs:annotation>
            <xs:documentation>
              <![CDATA[
                3-D Secure protocol version identifier (should always be 1.0.2).
              ]]>
            </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="CH" type="CH" />
        <xs:element name="url" type="xs:string" minOccurs="0" />
        <xs:element name="protocol" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
        <xs:element name="IReq" type="IReq" minOccurs="0" />
        <xs:element name="Extension" type="xs:anyType" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>
              <![CDATA[
                Message Extension: Requirements may emerge that cannot be supported by elements in the 3-D Secure messages;
                any data necessary to support these requirements must be carried in a message extension.
 
                Every extension is required to have an 'id' attribute and a 'critical' (true/false) attribute.
              ]]>
            </xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
   
  <xs:element name="PAReq">
    <xs:complexType>
      <xs:annotation>
        <xs:documentation>
        <![CDATA[Payer Authentication Request.]]>
        </xs:documentation>
      </xs:annotation>
      <xs:sequence>
        <xs:element name="version" type="xs:string">
          <xs:annotation>
            <xs:documentation>
            <![CDATA[
              3-D Secure protocol version identifier (should always be 1.0.2).
            ]]>
            </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="Merchant" type="Merchant" />
        <xs:element name="Purchase" type="Purchase" />
        <xs:element name="CH" type="CH" />
        <xs:element name="Extension" type="xs:anyType" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>
              <![CDATA[
                Message Extension: Requirements may emerge that cannot be supported by elements in the 3-D Secure messages;
                any data necessary to support these requirements must be carried in a message extension.
 
                Every extension is required to have an 'id' attribute and a 'critical' (true/false) attribute.
              ]]>
            </xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
 
  <xs:element name="PARes">
    <xs:complexType>
      <xs:annotation>
        <xs:documentation>
        <![CDATA[
          Payer Authentication Response.
        ]]>
        </xs:documentation>
      </xs:annotation>
      <xs:sequence>
        <xs:element name="version" type="xs:string">
          <xs:annotation>
            <xs:documentation>
            <![CDATA[
              3-D Secure protocol version identifier (should always be 1.0.2).
            ]]>
            </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="Merchant" type="Merchant" />
        <xs:element name="Purchase" type="Purchase" />
        <xs:element name="pan" type="xs:string" />
        <xs:element name="TX" type="TX" />
        <xs:element name="IReq" type="IReq" minOccurs="0" />
        <xs:element name="Extension" type="xs:anyType" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>
              <![CDATA[
                Message Extension: Requirements may emerge that cannot be supported by elements in the 3-D Secure messages;
                any data necessary to support these requirements must be carried in a message extension.
 
                Every extension is required to have an 'id' attribute and a 'critical' (true/false) attribute.
              ]]>
            </xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="id" use="required" type="xs:string" />
    </xs:complexType>
  </xs:element>
 
  <xs:complexType name="Error">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          Error message.
        ]]>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="version" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              3-D Secure protocol version identifier (should always be 1.0.2).
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="errorCode" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              Code indicating the problem identified in the message. Although there is a list of
              predefined error codes that should be used, all components must accepts any value.
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="errorMessage" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              Text describing the problem identified in the message.
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="errorDetail" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              May identify the specific data elements that caused the Error Code.
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="vendorCode" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              Error code (or explanatory text) to be used for trouble shooting.
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
 
  <!-- Message components -->
 
  <xs:complexType name="Browser">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          Browser information.
        ]]>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="deviceCategory" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              Indicates the type of device or channel being used for shopping.
   
              0: The client environment is
              such that the full size messages (PAReq/PARes) will be used and the core protocol
              specification governs. For
              example, PC (HTML). (Default value; i.e. implied if not specified otherwise).
   
              1: The client is a constrained
              device, such as WAP phone, where the condensed messages (CPRQ/CPRS) will be used and
              the Extension for Mobile
              Internet Devices must be followed.
   
              2: The client uses two-way messaging (SMS or USSD) and the
              Extension for
              Voice and Messaging Channels must be followed.
   
              3: The client uses the voice channel and the
              Extension for
              Voice and Messaging Channels must be followed.
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="accept" type="xs:string" minOccurs="0" />
      <xs:element name="userAgent" type="xs:string" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>
 
  <xs:complexType name="CH">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          Cardholder information.
        ]]>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="enrolled" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>
          <![CDATA[
            3-D Secure enrollment status.
   
              Y: Authentication available
   
              N: Cardholder not participating
   
              U: or
              Unable to authenticate
          ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="acctID" type="xs:string" minOccurs="0" />
      <xs:element name="expiry" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              Year Month (YYMM).
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
 
  <xs:complexType name="IReq">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[Invalid request data.]]>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="iReqCode" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              Code indicating the problem identified in the message. Although there is a list of
              predefined invalid-request codes that should be used, the MPI must accepts any value.
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="iReqDetail" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              May provide supporting detail, such as the specific data elements that caused the Invalid Request Code.
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="vendorCode" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[Error code (or explanatory text) to be used for trouble shooting.]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
 
  <xs:complexType name="Merchant">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          Merchant information.
        ]]>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="acqBIN" type="xs:string" />
      <xs:element name="merID" type="xs:string" />
      <xs:element name="password" type="xs:string" minOccurs="0" />
      <xs:element name="name" type="xs:string" minOccurs="0" />
      <xs:element name="country" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              ISO 3166 three digit country code.
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="url" type="xs:string" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>
 
  <xs:complexType name="Purchase">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          Purchase information.
        ]]>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="xid" type="xs:string" />
      <xs:element name="date" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              Date in the pattern: YYYYMMDD HH:MM:SS
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="amount" type="xs:string" minOccurs="0" />
      <xs:element name="purchAmount" type="xs:string" />
      <xs:element name="currency" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              ISO 4217 three digit currency code.
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="exponent" type="xs:string" />
      <xs:element name="desc" type="xs:string" minOccurs="0" />
      <xs:element name="Recur" type="Recur" minOccurs="0" />
      <xs:element name="install" type="xs:string" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>
 
  <xs:complexType name="Recur">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          Recurring payment information.
        ]]>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="frequency" type="xs:string" />
      <xs:element name="endRecur" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              Date in the pattern: YYYYMMDD
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
 
  <xs:complexType name="TX">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          Transaction information.
        ]]>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="time" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              Date in the pattern: YYYYMMDD HH:MM:SS
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="status" type="xs:string">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              Transaction status.
       
                Y: Authentication successful.
       
                N: Authentication failed.
       
                U: Authentication
                could not be performed.
       
                A: Attempts processing performed.
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="cavv" type="xs:string" minOccurs="0" />
      <xs:element name="eci" type="xs:string" minOccurs="0" />
      <xs:element name="cavvAlgorithm" type="xs:string" minOccurs="0">
        <xs:annotation>
          <xs:documentation>
            <![CDATA[
              Indicates the algorithm used to generate the Cardholder Authentication Verification Value.
     
                0: HMAC (as per SET TransStain) (no longer in use for version 1.0.2)
     
                1: CVV (no longer in use for version 1.0.2).
     
                2: CVV with ATN.
     
                3: MasterCard SPA algorithm.
 
                4: AMEX algorithm.
 
                7: Required for Use with EMV 3DS.
            ]]>
          </xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:schema>

For a description of the XML Signature standard used by 3-D Secure protocol, please refer to the corresponding W3C Recommendation.