Union Pay Schema

The Union Pay schema is created based on the official Union Pay interface documentation

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
<?xml version="1.0" encoding="UTF-8"?>
           elementFormDefault="unqualified" attributeFormDefault="unqualified">
 
  <xs:element name="UPACPPay" type="UPACPPayType"/>
 
  <xs:complexType name="UPACPPayType">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          Union Pay Message Container.
        ]]>
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:choice>
        <xs:element ref="MsgReq"/>
        <xs:element ref="MsgRes"/>
      </xs:choice>
      <xs:element ref="Signature"/>
    </xs:sequence>
  </xs:complexType>
 
  <xs:element name="MsgReq">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          Union Pay Request Message (Authentication Transaction / Authentication Status Inquiry).
        ]]>
      </xs:documentation>
    </xs:annotation>
 
    <xs:complexType>
      <xs:sequence>
        <!-- Version number. Fixed value: 5.0.0 -->
        <xs:element type="xs:string" name="version"/>
 
        <!-- Payload encoding type. Default value: UTF-8 (Support UTF-8/GBK) -->
        <xs:element type="xs:string" name="encoding"/>
 
        <!-- Serial Number of RSA Certificate -->
        <xs:element type="xs:string" name="certId"/>
 
        <!-- Sign method. Fixed value. 01: RSA -->
        <xs:element type="xs:string" name="signMethod"/>
 
        <!--
            Transaction type. Fixed value.
            78: Authentication Status Inquiry
            79: Authentication Transaction
        -->
        <xs:element type="xs:string" name="txnType"/>
 
        <!-- Transaction sub-type. Fixed value: 10 indicate SecurePlus authentication -->
        <xs:element type="xs:string" name="txnSubType"/>
 
        <!-- Fixed value: 000301 -->
        <xs:element type="xs:string" name="bizType"/>
 
        <!--
            0: General Merchant Direct Access
            1: Acquirer Access
            2: Platform Merchant Access
        -->
        <xs:element type="xs:string" name="accessType"/>
        <!--
            07: Internet
            08: Mobile
        -->
        <xs:element type="xs:string" name="channelType"/>
        <!--
            Frontend URL.
            UPOP send the transaction result notification to the URL via cardholder's browser.
        -->
        <xs:element type="xs:string" name="frontUrl" minOccurs="0"/>
        <!--
            Backend URL.
            If Merchant submits backend URL,
            UPOP send the transaction result notification to the URL via system.
        -->
        <xs:element type="xs:string" name="backUrl" minOccurs="0"/>
        <!--
            Acquiring institution code.
            To be sent when the access type is Acquirer Access
        -->
        <xs:element type="xs:string" name="acqInsCode" minOccurs="0"/>
        <!--
            Merchant ID.
            The unique merchant identity code assigned by UnionPay.
        -->
        <xs:element type="xs:string" name="merId"/>
 
        <!--
            Merchant Category.
            To be sent when the access type is Acquirer Access
        -->
        <xs:element type="xs:string" name="merCatCode" minOccurs="0"/>
 
        <!--
            Merchant name.
            To be sent when the access type is Acquirer Access
        -->
        <xs:element type="xs:string" name="merName" minOccurs="0"/>
        <!--
            Merchant Abbreviation.
            8 Chinese characters, To be sent when the access type is Acquirer Access.
        -->
        <xs:element type="xs:string" name="merAbbr" minOccurs="0"/>
 
        <!--
            Order ID.
            Generated at merchant side or by 3DS Server if absent.
        -->
        <xs:element type="xs:string" name="orderId"/>
 
        <!--
            Transaction time.
            The time when the Merchant sends the transaction.
        -->
        <xs:element type="xs:string" name="txnTime"/>
 
        <!--
            Account type.
            Static value: 01
        -->
        <xs:element type="xs:string" name="accType" minOccurs="0"/>
 
        <!--
           Account number.
        -->
        <xs:element type="xs:string" name="accNo" minOccurs="0"/>
 
        <!--
            Transaction currency code.
        -->
        <xs:element type="xs:string" name="currencyCode"/>
 
        <!--
            Transaction amount.
        -->
        <xs:element type="xs:string" name="txnAmt"/>
 
        <!--
             Merchant self-defined reserved field
             it will be returned without change in transaction response
         -->
        <xs:element type="xs:string" name="reqReserved" minOccurs="0"/>
 
        <!--
           Reserved filed in the request.
           Contains the Country Code, Merchant ID and Commodity Description.
           The value is a base64 encoding of the aforementioned values.
           Example: reserved = BASE64 ({country = 344& merUrl = www.test.com}
       -->
        <xs:element type="xs:string" name="reserved" minOccurs="0"/>
 
        <!--
            Cardholder verification information.
        -->
        <xs:element type="xs:string" name="customerInfo" minOccurs="0"/>
        <!--
            Encrypt Certificate ID
        -->
        <xs:element type="xs:string" name="encryptCertId" minOccurs="0"/>
        <!--
            Related Transaction Type.
 
            01: Purchase
            02: Pre-authorization
        -->
        <xs:element type="xs:string" name="relTxnType"/>
        <!--
          Cardholder IP.
        -->
        <xs:element type="xs:string" name="customerIp" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute type="xs:string" name="id"/>
    </xs:complexType>
  </xs:element>
 
  <xs:element name="MsgRes">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          Union Pay Response message (Authentication Transaction / Authentication Status Inquiry).
        ]]>
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
 
      <xs:sequence>
        <!-- Version number. Fixed value: 5.0.0 -->
        <xs:element type="xs:string" name="version"/>
 
        <!-- Payload encoding type. Default value: UTF-8 (Support UTF-8/GBK) -->
        <xs:element type="xs:string" name="encoding"/>
 
        <!--Serial Number of RSA Certificate-->
        <xs:element type="xs:string" name="certId"/>
 
        <!-- Fixed value. 01: RSA -->
        <xs:element type="xs:string" name="signMethod"/>
 
        <!--
            Fixed value.
            78: Authentication Status Inquiry
            79: Authentication Transaction
        -->
        <xs:element type="xs:string" name="txnType"/>
 
        <!-- Fixed value: 10 indicate SecurePlus authentication -->
        <xs:element type="xs:string" name="txnSubType"/>
 
        <!-- Fixed value: 000301 -->
        <xs:element type="xs:string" name="bizType"/>
 
        <!--
            0: General Merchant Direct Access
            1: Acquirer Access
            2: Platform Merchant Access
        -->
        <xs:element type="xs:string" name="accessType"/>
 
        <!--
          Acquiring institution code.
          To be sent when the access type is Acquirer Access
        -->
        <xs:element type="xs:string" name="acqInsCode"/>
 
        <!-- The unique merchant identity code assigned by UnionPay -->
        <xs:element type="xs:string" name="merId"/>
 
        <!--
            Order ID.
            Generated at merchant side or by 3DS Server if absent.
        -->
        <xs:element type="xs:string" name="orderId"/>
 
        <!--
            Transaction time.
            The time when the Merchant sends the transaction.
        -->
        <xs:element type="xs:string" name="txnTime"/>
 
        <!--
           Account type.
           Static value: 01
       -->
        <xs:element type="xs:string" name="accType" minOccurs="0"/>
 
        <!-- Account number -->
        <xs:element type="xs:string" name="accNo"/>
 
        <!-- Transaction currency code -->
        <xs:element type="xs:string" name="currencyCode"/>
 
        <!-- Transaction amount -->
        <xs:element type="xs:string" name="txnAmt"/>
 
        <!--
           Authentication status.
 
            Y - Authentication Successful Attempt Authentication
            F - Authentication Failed
            L - Authentication Failed (prohibited card)
            N - Non-authentication mode used
        -->
        <xs:element type="xs:string" name="activateStatus"/>
 
        <!--
          Merchant self-defined reserved field,
          returned without change from the transaction request.
        -->
        <xs:element type="xs:string" name="reqReserved"/>
 
        <!-- Reserved field in the authorization response. -->
        <xs:element type="xs:string" name="reserved"/>
 
        <!-- Response Code -->
        <xs:element type="xs:string" name="respCode"/>
 
        <!-- Response Message. -->
        <xs:element type="xs:string" name="respMsg"/>
 
        <!-- The original response code. -->
        <xs:element type="xs:string" name="origRespCode"/>
 
        <!-- The original response message. -->
        <xs:element type="xs:string" name="origRespMsg"/>
      </xs:sequence>
      <xs:attribute type="xs:string" name="id"/>
    </xs:complexType>
  </xs:element>
 
  <xs:element name="Signature">
    <xs:annotation>
      <xs:documentation>
        <![CDATA[
          Union Pay Message Signature.
        ]]>
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element type="xs:string" name="SignatureValue"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
 
</xs:schema>

For a description of the XML Signature standard used by Union Pay protocol, please refer to the official documentation provided by Union Pay.