Part II Debit Credit Application Card Specification
Part II Debit Credit Application Card Specification
Part II Debit Credit Application Card Specification
— Basic Specifications
V1.0.2
THIS PAGE IS INTENTIONALLY LEFT BLANK.
PartII Debit/Credit Application Card Specification
Table of Contents
SUMMARY OF REVISIONS.................................................................................................... 1
2 REFERENCES ..................................................................................................................... 3
3 OVERVIEW 4
UPI Confidential i
PartII Debit/Credit Application Card Specification
UPI Confidential ii
PartII Debit/Credit Application Card Specification
9 CARDHOLDER VERIFICATION................................................................................... 43
UPI Confidential iv
PartII Debit/Credit Application Card Specification
14 COMPLETION .................................................................................................................. 92
14.7 ONLINE PROCESSING REQUESTED, BUT ONLINE AUTHORIZATION NOT COMPLETED .... 102
UPI Confidential v
PartII Debit/Credit Application Card Specification
UPI Confidential vi
PartII Debit/Credit Application Card Specification
A.3 REGULATIONS ON THE DEFINITION OF CARD AND ISSUER DATA ELEMENT ................... 197
B.1 BASIC PROCESSING RULES FOR ISSUER SCRIPT COMMAND .......................................... 200
B.8.5 B.8.5 Processing status Returned by the Response Message ......................... 213
UPI Confidential ix
PartII Debit/Credit Application Card Specification
UPI Confidential x
PartII Debit/Credit Application Card Specification
H.2.2 Obtaining Electronic Cash Balance Using GET DATA Command ................ 252
UPI Confidential xi
PartII Debit/Credit Application Card Specification
Summary of Revisions
UPI Confidential 1
PartII Debit/Credit Application Card Specification
1 Application Scope
UPI Confidential 2
PartII Debit/Credit Application Card Specification
2 References
The terms and conditions of the following documents quoted in this book have
become the terms and conditions of the Specification. The modification list
(excluding corrected contents) or revised edition attached to the dated documents
shall not apply to this book. However, Participants may study whether to apply the
latest versions of such documents. The latest versions of non-dated documents shall
apply to this book.
EMV Integrated Circuit Card Specifications for Payment Systems, Version 4.3
Book 1 Application Independent ICC to Terminal Interface Requirements
EMV Integrated Circuit Card Specifications for Payment Systems, Version 4.3
Book 2 Security_and_Key_Management
EMV Integrated Circuit Card Specifications for Payment Systems, Version 4.3
Book 3 Application Specification
ISO 4217:2001 ISO 4217:2001 Codes for the representation of currencies and
funds
UPI Confidential 3
PartII Debit/Credit Application Card Specification
3 Overview
The following sections describe the debit/credit transaction processing. They are
divided into mandatory which may be optional in some scenarios or optional. But
all of them are performed based on the parameters in the card or the terminal.
When a card is inserted into a terminal, the terminal determines which applications
are supported by both the card and the terminal. The terminal detects the
applications supported by both the terminal and the card, and displays them for the
user to select. If those applications cannot be displayed on the terminal, it
automatically selects the application of the highest priority in the card as designated
by the Issuer in advance.
After UnionPay IC debit/credit application is selected, the terminal will request the
card to get the chip data from the storage and the functions shall be used during a
transaction. Based on different situations (domestic or overseas), the chip data or
the supported functions may be different. The terminal reads the data indicated by
the card and uses the list of supported functions to determine the processes to be
executed.
The terminal determines if the offline static or dynamic data authentication should
be used to authenticate a card offline based on whether the card and the terminal
support those methods.
Static Data Authentication (SDA) will validate those important personal data which
are easy to be fraudulently altered after card is issued. The terminal will use CA
public key to decrypt Issuer public key certificates and get Issuer public key. This
process is able to generate a hash value that shall be matched with the one is
encrypted by Issuer private key for ensuring those personal data are not changed.
Dynamic Data Authentication (DDA) will validate whether the important personal
data is fraudulently altered after card is issued or the card is fake. There are two
types of DDA: DDA and Combined DDA/AC Generation (CDA). For both types,
the terminal validates the card static data in a similar manner to SDA.
UPI Confidential 4
PartII Debit/Credit Application Card Specification
As for executing DDA, the terminal will request the card to generate a randomly
dynamic (transaction unique) data which is a digital signature and use those
retrieval of public keys to decrypt the dynamic signature cryptogram to match the
original data for ensuring the card is not a counterfeit one created with data
skimmed from a legal card.
Cardholder verification is to confirm the legality of the cardholder and the card is
not lost or stolen. The terminal determines which verification method is to be used
via examining the card verification method list (CVMs) of the card. The issuer
establishes priorities on those cardholder verification methods and specific
cardholder verification method is adopted based on terminal capabilities and
transaction features. For instance, If CVM is offline PIN, the terminal will prompt
the cardholder to enter a PIN on the terminal and the card will check if it is valid.
The CVM list can also include online PIN, signature or no CVM required during
transaction.
Terminal Risk Management checks whether the transaction has exceeded the
merchant floor limit, the account number is located in the terminal exception file,
the consecutive offline transaction time exceeds the limit, the card is a new card,
the merchant forces an online transaction, and the transaction is randomly selected
to go online or velocity checking. The terminal will use those chip data in the card
to conduct such above checks.
UPI Confidential 5
PartII Debit/Credit Application Card Specification
Issuer action codes (IACs) field transmitted from the card to the terminal and
terminal rules set in the terminal action codes (TACs). After the transaction
processing is determined, the terminal requests application cryptogram from the
card. Different application cryptograms correspond to different transaction
processing: the transaction certificate (TC) should be interpreted as an approval,
authorization request cryptogram (ARQC) as online request and application
authentication cryptogram (AAC) as rejection. See Table 1. The terminal shall also
specify whether the transaction is eligible for CDA execution.
Cryptogram type
Approved transaction TC
After receiving the Application Cryptogram request from the terminal, the card
performs its own risk management as Card Action Analysis to determine if the
transaction processing set by the terminal should be changed and the check may
include prior incomplete online transaction, Issuer authentication failure or offline
data authentication failure on previous transaction, and the transaction counters or
amount of velocity check limits has been reached. The card can change offline
approval to online authorization or offline declined, but it cannot reverse the offline
declined decision made by terminal.
After those above checks are completed, the card uses the application data and a
secret DES key in the card to generate Application Cryptogram and return that to
the terminal. For offline approved transaction, TC and the data used to generate TC
are transmitted to the issuer in a clearing message for future cardholder disputes or
chargeback processing. TC can be used as “evidence” for verifying if the merchant
or the acquirer has changed the transaction data when the cardholder disputes a
transaction. Correspondingly, the cryptogram type is AAC as an offline declined
transaction and ARQC is requesting for online authorization.
After the card makes the conclusion of approving the transaction (the card returns
TC), the card will record the transaction logs on the chip.
If both card and terminal determines that an online authorization is required for the
transaction and the terminal has the online capability, the terminal sends an online
UPI Confidential 6
PartII Debit/Credit Application Card Specification
authorization message to the issuer. The message includes ARQC Cryptogram, the
data used to generate ARQC and the indicator shows the offline processing result.
During the online processing, the issuer uses the Processing Flow named Card
Authentication Method (CAM) to verify ARQC and authenticate that card. The
issuer can consider CAM and offline processing results in its authorization
decision.
If the authorization response includes an ARPC and the card supports issuer
authentication, the card will validate ARPC to check whether the response comes
from a true issuer (or its agent). Once the issuer authentication is validated, the card
can reset some security-related parameters in the card. This can prevent counters
and indicators to be reset through simulating online processing or fraudulently
approving transaction to attack the card. If issuer authentication is failed, the
subsequent transactions for that card must be sent online for authorization until the
issuer authentication is successful. The issuer can setup that card to decline the
transaction when the issuer authentication is failed.
The card and the terminal perform the final processing to complete the transaction.
The card may decline a transaction approved by the issuer based on the issuer
authentication results and the issuer-encoded parameters in the card as the card risk
management. The card decides whether to reset the card based counter and
indicator (bit) according to the transaction disposition, issuer authentication results
and issuer encoded rules. The card generates TC or AAC when it approves or
declines the transaction.
After the card makes the conclusion to approve the transaction (the card returns
TC), the card will record the transaction logs.
If the issuer includes the Script Updates in the authorization response message, the
terminal will transmit the Script Commands correctly to the card. Prior to applying
the update, the card will perform security check to ensure that the Script comes
from a valid issuer and has not been altered during the transmission. The supported
Script Command allows updating offline processing parameters, blocking and
unblocking the application, blocking the card, resetting offline PIN try counter and
changing offline PIN value.
UPI Confidential 7
PartII Debit/Credit Application Card Specification
UPI Confidential 8
PartII Debit/Credit Application Card Specification
UPI Confidential 9
PartII Debit/Credit Application Card Specification
Card risk management Mandatory; some card risk management steps are
optional (refer to Chapter 14 card action analysis)
Optional
Advice message
multiple algorithm options provided
Application Cryptogram
Secure Messaging Two script types provided (EMV), only one script
type tag’72’ supported (UnionPay IC debit/credit)
UPI Confidential 10
PartII Debit/Credit Application Card Specification
GENERATE APPLICATION
Mandatory (EMV)
CRYPTOGRAM
Optional (EMV)
GET DATA
Mandatory (UnionPay IC debit/credit)
UPI Confidential 11
PartII Debit/Credit Application Card Specification
4 Application Selection
Application Selection processing determines the application that both card and
terminal support to perform a transaction. The Application Selection processing
consists of two steps:
1. The terminal establishes the application list supported by both card and
terminal;
2. A single application is identified and selected from the list to perform the
transaction.
The card data elements and brief descriptions used in application selection are
specified in the table below. For detailed descriptions on the data elements and
usage, please refer to Appendix A Card and Issuer Data Element List.
DDF defines the files under its directory structure. FCI of DDF
includes:
FCI template
DF name
Directory Definition File
(DDF) FCI Proprietary template
UPI Confidential 12
PartII Debit/Credit Application Card Specification
FCI template
DF NAME
Application tag
Application Elementary File Application Elementary File includes the data elements used
(AEF) by the application in processing.
UPI Confidential 13
PartII Debit/Credit Application Card Specification
It is the terminal data object list required by the card during the
Processing Option Data
Application initialization procedure. The contents include tags
Object List (PDOL)
and length of the data objects.
Terminal data used for application selection is specified in the table below. For
detailed descriptions on terminal data, please refer to the Terminal Specification.
UPI Confidential 14
PartII Debit/Credit Application Card Specification
Application selection It indicates whether partial selection is supported for the AID in
indicator the terminal
4.3 Command
SELECT
The terminal sends SELECT Command to the card to obtain the card supported
application information, which includes issuer parameters, such as application
priority, application name and language preference, etc. The Command can include
not only the Payment System Environment Directory name (used for Directory
selection method) and one Directory(DDF) name, but also a requested AID (used
for the List of AID method).
Command can have the following SW1 and SW2 return codes:
6A82 - The card does not support Directory selection method (The Command
includes name of the Payment System Environment); the selected file is not
found or it is the last file while P2 parameter indicates that there is another
application with the same AID (The Command includes AID);
If the card includes a PDOL, the PDOL is included in the Response information of
SELECT command as one part of FCI. During the Application initialization
processing, the terminal will transmit the data specified in the PDOL to the card.
UPI Confidential 15
PartII Debit/Credit Application Card Specification
READ RECORD
The card returns the requested record contents in the Response information. The
SW1 and SW2 response may have the following values:
The terminal can apply two methods to establish the application list supported by
both card and terminal.
As directory selection method is mandatory for the terminal but optional for
the card, the terminal shall select this method as the first priority. The terminal
reads from the card the Payment System Environment file which specifies all
payment applications supported by the card. The terminal adds any
applications in both card list and terminal list on the candidate list.
AID list selection method is mandatory to both the card and the terminal. The
terminal sends a SELECT command to the card for each application supported
by the terminal. If the card indicates that it supports the application in the
Response, the terminal adds the Application on the candidate list.
From the standpoint of the card, Directory Selection Method processing includes
the following steps:
1. The card receives a SELECT command from the terminal, requesting to select
PSE (file name “1PAY.SYS.DDF01”).
If the card does not have PSE, the card responds SELECT command and
indicates that the file does not exist (SW1 SW2=“6A82”);
If PSE is present, the card responds with SW1 SW2 = “9000” and the FCI
for PSE.
UPI Confidential 16
PartII Debit/Credit Application Card Specification
2. If PSE is present, the card accepts the READ RECORD command from the
terminal indicating the Short File Identifier and record number. The card
responds to each READ Record command with the requested record and SW1
SW2=“9000”. If the requested record does not exist, the card returns SW1
SW2=“6A83”.
2. Check whether AID of ADF Entry 1 or 2 matches with the AIDs of the
terminal, and add the application in the candidate list if they are matched;
4. Check whether AID of ADF Entry 3 matches the AID of the terminal, and add
the application in the candidate list if they are matched;
5. Complete candidate list when the card responds that the Payment system
directory has no other records.
PSE
Payment system
directory
Record 1 Record 2
From the standpoint of the card, AID list selection method includes the following
steps:
1. The card receives the SELECT command sent by the terminal, and the terminal
includes AID that the terminal supports the application list. The card checks
whether the card has any application whose AID matches (the AID length of
card can be longer than that of the terminal).
UPI Confidential 17
PartII Debit/Credit Application Card Specification
Card
Terminal AID Terminal Application Card AID
Application
UnionPay IC UnionPay IC
A0000003330101 A000000333010101
Debit/Credit debit
UnionPay IC UnionPay IC
A0000003330101 A000000333010102
Debit/Credit credit
If the AID matches, the card responds to the SELECT command and
indicates that the card supports the application (SW1 SW2=“9000”);
If the card cannot find the matched AID, it responds with SW1
SW2=“6A82” to indicate that that the application is not found;
If the card is blocked or the card does not support SELECT command, the
card responds with SW1 SW2=“6A81” to indicate that the transaction
shall be terminated.
2. If the matched card AID is longer than the terminal AID, the card responds the
entire card AID in the response information to the terminal for SELECT
command.
The card selects next application with this AID and provides the
application to the terminal in the SELECT command response.
When the card has no more application with such AID, the card shall
respond with SW1 SW2 =“6A82” to indicate that all the matched
applications have been selected.
If the candidate list has no less than one application that is supported by both card
and terminal, the terminal and the cardholder shall determine which application
shall be selected. The terminal sends a SELECT command to the card, indicating
an application which is identified to perform the transaction. If the card agrees with
the selection, it responds with SW1 SW2 “9000”. If the application is blocked,
Card must return FCI and response code ‘6283’. ”.
UPI Confidential 18
PartII Debit/Credit Application Card Specification
Terminal Card
Terminal
Terminates SW1/2-6A81 Y N
Transaction
N Y
PSE
SW1/2-6283 Y Blocked?
Terminal
Switches to list
Of AIDs method Requests Respond with
directory records FCI for PSE and N
specified by SFI SW1/2=9000
in FCI
Requested
READ RECORD command
Record found?
All directory
A Y Record SW1/2=6A83 N
Processed?
C
N
Increment
Any more Process entries Y
Record N entries In record
SW1/2=9000
Number by 1
Terminal
Next entry=
Supports Y ADF N C
Application?
N Y
Add to
Candidate list
A
C
Terminal
Determines
Application to use
Respond with
Request FCI for SELECT Command with
FCI for ADF &
Selected application AID of application to be used
SW1/2 =9000
application
initialization,please
refer to chapter 5
UPI Confidential 19
PartII Debit/Credit Application Card Specification
Terminal Card
N
Card blocked Y
A
N
Terminal
P2=02 SW1/2=6A81
Terminals transaction
(select next)
Card AID
Application SW1/2=
(Dfname) matches Y N Add to Candidate List
blocked 9000
Terminal AID?
Y
Y
SW1/2=6283
N
SW1/2=6A82
Another
Application
Matching applcaiton Y Y SW1/2=6283
blocked
For this AID
Respond with
AID & SW1/2 Add to Candidate List
=9000
N SW1/2=6A82
A
Final Selection
Terminal
Determines
Application to use
application
initialization,please
refer to chapter 5
Application Initialization
The terminal sends GET PROCESSING OPTIONS command to the card. During
Application selection, the SELECT command Response information include PDOL,
GPO Command shall include the terminal data specified in PDOL, such as the
terminal data are required in the transaction log..
UPI Confidential 20
PartII Debit/Credit Application Card Specification
5 Application Initialization
In the application initialization processing, the terminal notifies the card to start a
transaction by sending the GET PROCESSING OPTIONS Command to the card.
In this Command, the terminal provides the card with data elements requested in
Processing Option Data Object List (PDOL). PDOL (a list of tags and length of
data elements) is the optional data elements to be requested by the card to the
terminal during application selection process.
The card will respond with Application Interchange Profile (AIP) and Application
File Locator (AFL) information in the GPO Command. AIP specifies the functions
to be performed during transaction process; AFL specifies the Short File Identifier
for data storage location to be read during transaction processing, record number
and the static signature data storage location required for offline data
authentication.
Card data elements used for application initialization are listed in the table below.
UPI Confidential 21
PartII Debit/Credit Application Card Specification
Terminal data used for application initialization processing is specified in the table
below.
5.3 Command
The terminal uses GET PROCESSING OPTIONS Command to inform the card
that the transaction begins.
The Command includes value part of terminal data element requested by the card in
PDOL. PDOL consists of optional data provided by the card during application
selection.
The card response data consists of AIP and AFL. AIP specifies the functions
performed during transaction processing; AFL specifies the Short File Identifier for
UPI Confidential 22
PartII Debit/Credit Application Card Specification
After receiving GET PROCESSING OPTIONS Command from the terminal, the
card will:
2. Determine the file and records to be read and file location to establish AFL.
And return different AFL and AIP based on different transaction situations.
a) Increment ATC by 1, if ATC reaches 65535, then the card will block the
application permanently.
UPI Confidential 23
PartII Debit/Credit Application Card Specification
Card Terminal
Terminal deletes
YES Get Processing Options transaction from the
command, candidate list and
respond’6985' returns to step of
application selection
NO
Set CID as 00
Application Selection
The card provides the PDOL (if any) to the terminal in FCI of SELECT command
Response.
Application Selection
UPI Confidential 24
PartII Debit/Credit Application Card Specification
If any regional restriction or any other restriction is effective, the transaction shall
return to the application selection stage. The application is deleted from the
candidate list and another application will be selected.
The card returns AFL to the terminal together in the response to the GET
PROCESSING OPTIONS Command. The terminal uses AFL to determine the
application data to be read from the card and the data to be used for offline data
authentication.
The terminal uses AIP in the response to the GET PROCESSING OPTIONS
Command to determine the offline data authentication type to be supported by the
card.
Cardholder Verification
The terminal uses AIP in the response to the GET PROCESSING OPTIONS
Command to determine whether cardholder verification is supported by the card or
not.
Online Processing
The terminal uses AIP in the response to the GET PROCESSING OPTIONS
Command to determine whether issuer authentication is supported by the card or
not.
UPI Confidential 25
PartII Debit/Credit Application Card Specification
In Read Application Data processing, the terminal reads the card data necessary to
process transactions and determines the data to be authenticated during SDA or
DDA.
The table below specifies the data to be applied during read application data
processing and response from the card during the application initialization
processing.
The table below specifies the data while reading Application Elementary File
records from the card.
UPI Confidential 26
PartII Debit/Credit Application Card Specification
During this stage of read application data, the card does not use terminal data.
6.3 Command
READ RECORD
The received command to the card shall include Short File Identifier (SFI) of the
file to be read and record number of the record in the file
The response of the card shall include the requested record in the data file.
The card receives the READ RECORD command from the terminal and returns the
record contents requested by the terminal. Each record specified in AFL is read
with one READ RECORD command.
The terminal sends READ RECORD commands consecutively until all records
specified in AFL are read.
Record data for offline data authentication adopts TLV encoding format with the
ID number of ‘70’.
For data read with READ RECORD command, please refer to Appendix A.2.
Application Initialization
In the application initialization processing, the card returns AFL to the terminal,
indicating the data records to be requested by the terminal.
The terminal uses a static data list established during Read application data
processing to conduct SDA authentication or IC card public key authentication
during DDA.
UPI Confidential 27
PartII Debit/Credit Application Card Specification
Offline Data Authentication is the processing that the terminal authenticates the
data in the card using RSA public key technology. There are two types of offline
data authentication:
SDA indicates that the terminal authenticates the static (constant) data in the card.
SDA can ensure that the data selected by the issuer will not be altered after card
personalization.
The result of offline data authentication is one of the reference conditions for the
card and the terminal to determine transaction offline, online or decline. The online
authorization system may also refer to the offline data authentication results before
making the authentication response decision.
The terminal with offline capability must support offline data authentication, but it
is optional for the card.
Please refer to 5.1 Key and Certificate in the Security Specification for details.
The terminal uses Application Interchange Profile (AIP) of the card and offline data
authentication supported by the terminal itself to determine whether SDA, DDA or
CDA shall be performed.
The card data that the terminal uses to determine whether to perform SDA or DDA
is specified in the table below.
UPI Confidential 28
PartII Debit/Credit Application Card Specification
7.2.2 Processing
Only one type of offline data authentication will be performed for one transaction.
CDA is superior to DDA, while DDA is superior to SDA. If the card or the
terminal supports no offline data authentication, offline data authentication will not
be performed.
If the terminal determines that both the card and the terminal support CDA, CDA
shall be performed; otherwise, if both support DDA, DDA shall be performed;
otherwise, if both support SDA, then the SDA shall be performed.
Record data for offline data authentication adopts TLV encoding type marked with
‘70’. As for the two types of files whose SFI is within ‘1-10’ and ‘11-30’
respectively, data processing shall follow different procedures during offline data
authentication processing. For details, please refer to relevant definitions in
Security part of This Specification.
If the record data applied for offline data authentication does not adopt TLV
encoding format marked with ‘70’, the terminal will take that offline data
authentication has been executed but failed. The terminal will set the “Offline data
authentication execution” bit in TSI as 1, and set the corresponding “SDA
FAILURE” or “DDA FAILURE” or “CDA FAILURE” bit in TVR as 1.
During SDA, the terminal used RSA public key verification technology to validate
whether the key data in the card has not been altered since card personalization.
Card data used by the terminal for SDA is specified in the table below.
UPI Confidential 29
PartII Debit/Credit Application Card Specification
Registered application identification RID together with CA public key index identifies the
(RID) part in AID public key of the terminal.
UPI Confidential 30
PartII Debit/Credit Application Card Specification
The table below specifies the card internal data related to SDA.
UPI Confidential 31
PartII Debit/Credit Application Card Specification
7.3.3 Command
During SDA, the terminal uses RSA public key verification technology to restore
and validate issuer public key and to validate SAD from the card. For details,
please refer to 5.2 Static Data Authentication (SDA) in the Security Specification.
Descriptions are summarized as follows:
The terminal uses PKI and RID in the card to determine which CA public key shall
be applied.
The terminal uses CA public key to unlock the issuer PK certificate in the card and
to restore the issuer public key in the certificate
If all the SDA procedures are completed successfully, it can be deem that SDA
succeeded.
UPI Confidential 32
PartII Debit/Credit Application Card Specification
During DDA processing, the terminal uses RSA public key technology to
determine whether key data in the card has been altered or not since card
personalization and whether the card is a counterfeit card or not.
UnionPay supports two DDA types: standard DDA and CDA. Under these two
types, the terminal validates whether static data in the card is altered or not and
validates the dynamic cryptogram generated by a card. During standard DDA, the
card generates dynamic signature with dynamic data from the card, the terminal
and the transaction data when it responds to INTERNAL AUTHENTICATE
Command before it performs card action analysis. During CDA, the card generate
dynamic signature when it responds to GENERATE Application Cryptogram
Command. The signature includes Application Cryptogram, Cryptogram
Information Data and the dynamic data of the card, the terminal and the transaction
data used as similar to standard DDA.
Except for SAD, all the data used during SDA is used in DDA. The table below
specifies the data only applicable for DDA.
UPI Confidential 33
PartII Debit/Credit Application Card Specification
The following table specifies the data elements used inside the card during DDA.
Table 15: Offline Data Authentication - Card Internal Data Elements for DDA
Card Verification Results (CVR) Offline dynamic data authentication for the last transaction
fails, and offline data authentication for the offline declined
transaction is executed.
The table below lists the terminal data applied by the card during DDA.
UPI Confidential 34
PartII Debit/Credit Application Card Specification
7.4.3 Command
The terminal sends the first GENERATE AC Command during card action analysis
processing. When either of the following condition is satisfied, the transaction shall
perform CDA:
7.4.4 Processing
During DDA processing, the terminal uses RSA public key technology to validate
the issuer public key certificate, the IC card public key certificate and the signed
dynamic application data (dynamic signature) in the card.
During DDA processing, the only process of the card is to generate the dynamic
signature.
For detailed descriptions on DDA, please refer to 5.3 Dynamic Data Authentication
(DDA) in Security Specification. The following part is a summary.
UPI Confidential 35
PartII Debit/Credit Application Card Specification
The terminal applies PKI and RID in the card to determine which CA public key
shall be applied.
The terminal applies CA public key to unlock the issuer PK certificate in the card
and to restore issuer public key in the certificate.
The terminal uses the issuer public key to unlock the IC card public key certificate
in the card and to authenticate the IC card public key and static data Hash result in
the card. IC card public key certificate ensures the validity of IC card public key.
The terminal uses the actual data elements in the card to re-calculate the Hash
values and to check whether the new Hash Value matches the restored Hash Value.
a) Set the offline dynamic data authentication performed bit in CVR as “1”;
e) Use IC card private key to sign the signed dynamic application data;
a) Use IC card public key to decrypt dynamic signature and to restore data
element Hash Value;
UPI Confidential 36
PartII Debit/Credit Application Card Specification
If all the procedures above are successful, then standard DDA can be considered as
successful.
The remaining step for the card is to generate a dynamic signature that includes
Application Cryptogram. This step is performed when the card receives
GENERATE Application Cryptogram command. This can happen only when
the transaction complies with CDA execution conditions and Application
Cryptogram type is TC or ARQC.
The remaining step for the terminal is to validate the dynamic signature
generated by the card. This step is performed during online processing. If the
validation fails, the transaction is declined.
The terminal reads data from the card. If the card supports SDA, the data shall
include the issuer public key certificate, other data related to the key and the signed
static authentication data (SAD). If the card supports DDA, the data shall include
DDOL, IC card public key certificate and other data related to key.
The terminal uses the results of SDA or DDA as well as parameters of the card and
the terminal to determine whether the transaction is declined, sent online for
authorization or approved offline transaction.
If the transaction is eligible for CDA, the card puts ARQC or TC in the signed
dynamic application data and uses IC card private key for signing before it
responds to the terminal.
If the indicator of Dynamic Data Authentication failure is “1”, the card sets the
Dynamic Data Authentication of the last transaction as failure in CVR and the
UPI Confidential 37
PartII Debit/Credit Application Card Specification
transaction rejection bit is “1”. If the indicator of Static Data Authentication failure
is “1”, the card sets a similar bit in CVR.
If the transaction is declined and the indicator for Dynamic Data Authentication
failure in the TVR sent by the terminal is “1”, the card sets the indicator of
Dynamic Data Authentication failure in the card as “1”. As for SDA, similar
processing shall be taken.
Online Processing
Completion
Performed successfully;
Not supported.
If the transaction is declined and the “CDA FAILURE” in TVR sent by the
terminal is “1”, the card sets indicators of Dynamic Data Authentication failure as
“1”.
UPI Confidential 38
PartII Debit/Credit Application Card Specification
8 Processing Restriction
The terminal uses data element from terminal and card to perform the Processing
Restriction such as checking the application version, the effective date, the
expiration date, and etc.
The table below listed the card data elements used during Processing Restriction.
The table below lists the terminal data elements used during Processing Restriction.
UPI Confidential 39
PartII Debit/Credit Application Card Specification
8.3 Processing
In Processing Restriction, the card does not perform any processing. The following
describes how the terminal uses card data during Processing Restriction.
The terminal compares the application version numbers in the card and the
terminals to verify the consistency.
During Application Usage Control, the terminal checks different situations of the
point of transaction to determine whether the transaction shall proceed. If the
terminal receives the Application Usage Control (AUC) and the issuer country code
data in the step of read application data, the terminal checks the following
application restrictions:
Domestic
The terminal compares the issuer country code and the terminal country code. If
these two are consistent, the transaction can be taken as a domestic one and
therefore, the domestic indicator corresponding to Transaction Type in AUC must
be “1”, which indicates the requested service is allowed to be conducted.
International
If the country codes are different, the transaction shall be taken as an international
one, and therefore, the international indicator corresponding to Transaction Type in
UPI Confidential 40
PartII Debit/Credit Application Card Specification
AUC must be “1”, which indicates the requested services are allowed to be
conducted.
2. ATM Check
If the terminal device is ATM, the indicator for “Valid at ATM” in AUC must be
“1”. If the terminal device is not ATM, the indicator for “Valid at terminals other
than ATMs” bit in AUC must be “1”.
If any of the checks above performed by the terminal fails, the terminal will mark
in TVR that “the card product does not allow the requested service”.
The table below specifies the encoding format for AUC. If the indicator value is
“1”, it indicates that the usage is supported.
Byte b8 b7 b6 b5 b4 b3 b2 b1 Usage
International commodity is
1 x x x 1 x x x x
valid.
1 x x x x x x 1 x ATM is valid.
UPI Confidential 41
PartII Debit/Credit Application Card Specification
Byte b8 b7 b6 b5 b4 b3 b2 b1 Usage
When the card application data include application effective date, the terminal
performs application effective date check to ensure that the application is valid. If
application effective date is later than the transaction date, the terminal shall
indicate in TVR that the application is not effective yet.
Application expiration date check is mandatory to ensure that the application is not
expired. If the application expiration date is earlier than the transaction date, the
terminal shall indicate in TVR that the application has been expired.
The terminal uses READ RECORD command to get record data from the card. The
data include issuer country code, application version number, application expiration
date, and if present, the AUC and application effective date.
At the terminal action analysis stage, the terminal checks Issuer Action Code (IAC)
and Terminal Action Code (TAC) to decide the transaction results.
UPI Confidential 42
PartII Debit/Credit Application Card Specification
9 Cardholder Verification
Cardholder verification is used to ensure that the cardholder is legitimate and the
card is not lost or stolen.
The terminal uses the rules in CVM list in the card to select the cardholder
verification method. The selection shall be based on the terminal type (cash or
purchase), transaction amount and terminal capability, etc. CVM list also indicates
to the terminal how to process in case of the CVM fails.
The table below describes the card data used by the terminal during CVM list
processing.
Amount Y
UPI Confidential 43
PartII Debit/Credit Application Card Specification
Subfields Description
Signature
Present certificate
Example
UPI Confidential 44
PartII Debit/Credit Application Card Specification
CVM List
If the terminal supports offline PIN, offline PIN for POS transactions;
If the terminal does not support offline PIN, signature for POS transactions;
If the terminal supports offline PIN or signature, signature is not required for
POS transaction.
CVM entry 1
0b- Cardholder
CVM code verification fails if CVM
fails
CVM entry 2
For POS transactions, this entry shall
03- if CVM supported by be performed
CVM condition
the terminal If the terminal supports offline
plaintext PIN verification, this CVM
000001b-Offline plaintext shall be performed
CVM type
PIN verification-
UPI Confidential 45
PartII Debit/Credit Application Card Specification
0b- Cardholder
CVM code verification fails if CVM
fails
CVM entry 3
CVM entry 4
0b- Cardholder
CVM code verification fails if CVM
fails
The table below describes the card data used by the card.
UPI Confidential 46
PartII Debit/Credit Application Card Specification
The counter indicates the remaining PIN try times. The card uses
GET DATA command to return the PIN try counter (optional). The
counter is returned to the terminal during the verification
command.
This data is not necessarily readable. When the issuer wishes that
the terminal can obtain prompt information before the cardholder
inputs PIN for the last time, the data must be able to be read out
through GET DATA command; otherwise, the data shall not be
read by the terminal through GET DATA Command.
Offline PIN The card offline PIN is securely stored in the card.
UPI Confidential 47
PartII Debit/Credit Application Card Specification
9.3 Command
GET DATA - The command is used by the terminal to obtain PIN try counter
value from the card. It is optional.
If the card does not support to return PIN try counter by GET DATA command, the
card will respond “6A88”.
If the card supports offline PIN processing, it shall support VERIFY command.
Response status code SW1/2 of the command can have the following returned
values:
“6984”, if the try limit of the last transaction has been exceeded; this
value shall be returned when the VERIFY command is first processed
during this transaction.
“6983”, the try limit of the transaction has been exceeded; this value shall
be returned when the card receives another VERIFY command.
9.4 Processing
The following describes the rules on dealing with different CVM types in the CVM
list.
Other than supplying the CVM list to the terminal during Read application data, the
card plays no role in CVM list processing.
After the terminal decides to input an offline PIN, it can send a GET DATA
command to obtain PIN try counter value.
a) If the card supports returning the PIN try counter with GET DATA
command, the card will:
UPI Confidential 48
PartII Debit/Credit Application Card Specification
Set the PIN try limit exceeded bit in CVR as “1” if PIN try
counter is “0”;
b) If the card does not support returning the PIN try counter with GET
DATA command, the card will return “6A88”.
Terminal Card
Card supports
GET DATA command NO
PIN try counter response?
Mistaken
response to
YES GET DATA
command
YES
After the cardholder enters the transaction PIN, the terminal sends a
VERIFY command that includes the transaction PIN entered. When the card
receives the VERIFY command, it shall set “offline PIN verification
performed” bit in CVR as “1”.
UPI Confidential 49
PartII Debit/Credit Application Card Specification
3. PIN verification
a) When PIN try limit has been exceeded, the card will:
b) PIN matching
If PIN try function is not blocked, the card shall conduct PIN verification.
If the PIN matches, the card will:
Set the PIN try counter at the maximum number (PIN try limit);
c) PIN Unmatching
If transaction PIN does not match the offline PIN in the card, the card
will:
The card will judge whether the PIN try limit is exceeded or not.
UPI Confidential 50
PartII Debit/Credit Application Card Specification
Card
VERIFY PIN try limit
command NO
exceeded?
YES
transaction? in CVR as 0
YES
YES
NO PIN try limit
SW1 SW2 = 9000
exceeded?
NO
SW1 SW1
SW2=698 SW2=6
4 983
Application
block due to PIN
try limit excess” bit in
ADA set as 1?
Block Application
Return VERIFY
command with response
code
SW1 SW2=63C0
4. Follow-up Processing
If PIN verification fails and there can be more PIN try times, the terminal will
prompt the cardholder to re-enter the transaction PIN and sends another VERIFY
command.
UPI Confidential 51
PartII Debit/Credit Application Card Specification
If PIN verification succeeds before the remaining try times are reduced to 0, the
card will:
Reset the PIN try counter at the maximum number (PIN try limit);
The cardholder can enter incorrect PIN consecutively until the counter is zero.
Then the terminal will not send VERIFY command to the card.
Application Initialization
The terminal reads the cardholder ID number, cardholder ID type, CVM list and
other card data required to process CVM List.
The terminal determines whether the transaction shall be declined, sent online for
authorization or approved offline based on the cardholder verification results and
parameters of the card and the terminal.
The card determines whether an advice shall be generated when PIN try limit is
exceeded based parameters in ADA.
The card determines whether the transaction shall be declined, or sent online for
authorization based on parameters in ADA when PIN try limit is exceeded during
the previous transactions.
Online Processing
CVM results include offline PIN verification results. The data is included in the
authorization request. The issuer shall consider the offline PIN verification results
when it makes authorization decision.
If CVM adopts online PIN, online request shall include the encrypted online PIN; if
CVM adopts offline PIN, online authorization request does not include the PIN
value.
UPI Confidential 52
PartII Debit/Credit Application Card Specification
Completion
If the terminal tries to perform online authorization for a transaction when PIN try
limit is exceeded, but fails, the card will determine whether the transaction shall be
declined or approved based on parameters of ADA.
The PIN CHANGE / UNBLOCK Command can be used to reset PIN try counter at
the maximum number (PIN try limit), and change the offline PIN value in the card.
UPI Confidential 53
PartII Debit/Credit Application Card Specification
The issuer shall support Terminal Risk Management. The terminal also needs to
support terminal risk management no matter whether the card supports terminal
risk management or not.
The table below specifies the card data used by the terminal during Terminal Risk
Management:
UPI Confidential 54
PartII Debit/Credit Application Card Specification
The table below specifies the terminal data used in terminal risk management.
Terminal Verification Results It is a set of indicators used to record all the processing
(TVR) results of terminal risk management.
UPI Confidential 55
PartII Debit/Credit Application Card Specification
10.3 Command
If the value of last online Application Transaction Counter (ATC) and the value of
Application Transaction Counter do not exist in the terminal, the terminal sends a
GET DATA command to the card to read Register for last online Application
Transaction Counter (ATC) and Application Transaction Counter (ATC). The data
is used during terminal velocity check and new card check.
If the card supports terminal velocity check or new card check, it shall return the
data to the terminal.
If the card does not support terminal velocity check or new card check, the data
shall be stored as UnionPay dedicated data elements and shall not be returned to the
terminal. Then the card responds SW1 SW2=“6A88”.
10.4 Processing
During terminal velocity check and new card check, the card performs no
processing except for responding to GET DATA Command.
The following describes how the terminal uses card data during terminal risk
management:
UPI Confidential 56
PartII Debit/Credit Application Card Specification
If there is terminal Exception file, the terminal shall check whether the application
primary account number (PAN) of the card is included or not.
Only on the terminal with online capability, can the merchant require the terminal
to perform online transaction. Card data is not needed during this step.
Floor Limit check is performed when the transaction amount exceeds the terminal
floor limit, the transaction is forwarded online. Card data is not needed during this
step.
The terminal with offline and online capability shall perform random selection of
online transaction processing. Card data is not needed during this step.
After consecutive offline transactions reach a certain times, Velocity check allows
the issuer to request online transaction processing. The issuer can select not to
support terminal Velocity check, then the upper and lower limit of consecutive
offline transaction (tag “9F14” and tag “9F23”) will not be written into the card
during personalization,.
During consecutive check, the terminal sends GET DATA Command to read the
value of last online ATC register and the value of ATC from the card.
The times of consecutive offline transactions are the difference between ATC and
the last online ATC register.
Note: the card can perform similar processing during card action analysis.
If the terminal performs new card check, the terminal checks whether the value of
the last online ATC register is zero or not (if any).
The terminal sends GET DATA Command to read the value of the last online ATC
register from the card.
Note: the card can perform similar processing during card action analysis.
UPI Confidential 57
PartII Debit/Credit Application Card Specification
Application primary account number which is used for terminal exception file
check;
Upper/lower limit for consecutive offline transaction which is used for terminal
velocity check (optional).
The terminal will make corresponding processing decision based on the setting of
the card and the terminal in case any of the following circumstance occurs.
UPI Confidential 58
PartII Debit/Credit Application Card Specification
During Terminal Action Analysis, the terminal will determine whether the
transaction shall be approved, declined or sent for online authorization based on the
offline processing results with the rules set by the issuer in the card and the rules
set by the payment system in the terminal. Terminal Action Analysis consists of the
following two steps:
The following specifies the card data used by the terminal during terminal action
analysis.
IAC-denial
IAC-default
UPI Confidential 59
PartII Debit/Credit Application Card Specification
It is suggested that IAC data should be used as the data for static offline data
authentication.
The table below specifies the data obtained by the terminal from previous steps for
cryptogram request.
The following specifies the terminal data used by the terminal during Terminal
Action Analysis.
TAC-denial
The acquirer sets the TVR condition bit that can cause
offline decline.
The acquirer sets the TVR condition bit that can cause
online transaction.
TAC-default
The acquirer sets the TVR condition bit that can cause
offline rejection when online transaction cannot be
performed.
The table below lists the terminal data elements used by the terminal when it
requests Application Cryptogram.
UPI Confidential 60
PartII Debit/Credit Application Card Specification
Transaction Certificate (TC) Hash The data element is optional. It is transmitted to the card
result through GENERATE AC Command as input data.
11.3 Command
Parameter P1 in the Command indicates the cryptogram type being requested and
whether the cryptogram is eligible for CDA. Data part in the command includes
terminal data elements requested by the card in CDOL1. CDOL1 is read by the
terminal from the card during read application data processing. When CDOL1
includes terminal capability data tag, and both the terminal capability data value
from the terminal and AIP in the card indicate that both the card and the terminal
support CDA, CDA will be performed.
11.4 Processing
Offline processing result check is performed by the terminal during terminal action
analysis using IAC from the card and TAC from the terminal.
After the card receives the Command, the card performs card action analysis
processing. (Next chapter: Card Action Analysis).
UPI Confidential 61
PartII Debit/Credit Application Card Specification
During read application data processing, the card returns the application data
records to the terminal, including IAC, CDOL1, etc.
During card action analysis, the card performs risk management to determine
whether the terminal can make transaction declined, approved offline or sent for
online authorization.
UPI Confidential 62
PartII Debit/Credit Application Card Specification
Card Action Analysis allows the Velocity check and other risk management check
set by the issuer in the card. This section describes the UnionPay defined card risk
management including the following checks:
The table below lists the card data used during Card Action Analysis processing.
Application Interchange Profile AIP includes the indicator that describes the capability of
(AIP) the card to support CDA and issuer authentication
UPI Confidential 63
PartII Debit/Credit Application Card Specification
UPI Confidential 64
PartII Debit/Credit Application Card Specification
UPI Confidential 65
PartII Debit/Credit Application Card Specification
Issuer country code (“9F57”) UnionPay dedicated data. It indicates country of the issuer.
Offline decline requested by the It is the card internal application indicator when transaction
card indicator decline is decided in the card risk management check.
PIN try times counter It records the remaining PIN try times.
The table below specifies the terminal data used during Card Risk Management.
UPI Confidential 66
PartII Debit/Credit Application Card Specification
Terminal Validation Results It is a series of indicators at the terminal that records offline
(TVR) processing results.
12.3 Command
Parameter P1 in the Command indicates the cryptogram type and whether CDA
needs to be performed. Data part of the Command includes the terminal data
requested in the CDOL1.
12.4 Processing
The card receives GENERATE AC Command from the terminal. Data part of the
command includes the terminal data requested by the card in the CDOL1. If both
CDOL1 and PDOL contain a tag (the tag includes but not limited to transaction
currency code '5F2A' and authorized amount '9F02', but excludes terminal
verification result '95', transaction status information '9B' and unpredictable number
'9F37'), while the value of the tag given by the terminal in the GENERATE AC
Command is inconsistent with the value of the tag from the GPO Command, the
card should read the value received from the GENERATE AC Command, and the
value should be used in all subsequent processes of the transaction. The card should
not give a non-9000 response to GENERATE AC Command due to inconsistency
UPI Confidential 67
PartII Debit/Credit Application Card Specification
of the tag value from the GENERATE AC Command with the tag value from the
GPO Command.
Table 32 lists the data required for supporting card risk management as indicated in
CDOL1.
The table below summarizes all card risk management checks, indicates which are
mandatory or optional and specifies the results.
If the issuer selects to perform any optional card risk management check, it needs
to ensure that the data for check is written into the card during card personalization
and that CDOL1 specifies tag and length of the terminal data required.
If the requested terminal data is not valid (i.e. data part in GENERATE AC
Command uses 0 for relevant bits), the card will skip to the next card risk
management check. If the card has no Application Default Action (ADA), the card
will use a default value of all zero.
Conditional – required if
Online authorization not
issuer Script Command or Request online processing,
completed (on previous
issuer authentication is and set CVR indicator
transaction)
supported
Conditional – required if
SDA failed on last transaction Set CVR indicator
SDA is supported
UPI Confidential 68
PartII Debit/Credit Application Card Specification
Velocity check on
accumulated offline Request online processing if
transaction amount in Optional the limit is exceeded.
application designated Set indicator in CVR.
currency
UPI Confidential 69
PartII Debit/Credit Application Card Specification
The card performs each card risk management check to decide if the condition has
occurred, then proceeds to the next check. If there is any check that is not supported,
the card continues conducting to the next check.
If the indicator is set, the card will request for online processing until transaction is
sent online and one of the following conditions is satisfied:
Note: this indicator is reset during completion based on issuer authentication status
and card parameters.
UPI Confidential 70
PartII Debit/Credit Application Card Specification
12.4.3.2 “Issuer Authentication Failed for the Last Transaction” Check (or
Mandatory but Not Performed)
If AIP in the card indicates that issuer authentication is supported, this check must
be performed. If issuer authentication for the last transaction (1) failed, or (2) is
mandatory (as indicated by the issuer authentication indicator) but not performed,
the card will request online processing.
If the issuer authentication failure indicator is set as “1”, the card will:
Set “Issuer authentication for last online transaction failed” bit in CVR as “1”;
If the ADA bit for Issuer Authentication Failure, Transmit Next Transaction
Online is “1”, Sets the internal online requested by card indicator as ‘1’.
If SDA failure indicator is set as “1”, the card sets “SDA for last transaction fails
and the transaction declined offline” in CVR as “1”.
If DDA failure indicator is set as “1”, the card sets “DDA for last transaction fails
and the transaction declined offline” in CVR as “1”.
The card sets Bit 8-5 of the fourth Byte of the CVR to the value of the Issuer Script
Command Counter using identical bit settings.
If the issuer script failure indicator is set as “1”, the card sets the “Issuer script
processing failed for last transaction” bit in CVR as “1”.
If the issuer script failure indicator is set as “1”, the card shall set the online
requested by the card indicator bit as “1” when the ADA bit for “If issuer Script
for the last transaction fails, the transaction is forwarded online” is set as “1”.
UPI Confidential 71
PartII Debit/Credit Application Card Specification
The check is optional. If the times of consecutive offline transactions exceed the
lower limit, the card will request for online authorization.
If the ATC register and UnionPay dedicated data for the last online transaction
have lower limit for consecutive offline transactions (tag “9F58”), the card can
perform the check.
If the difference between ATC and ATC register for the last online transaction is
larger than the lower limit for consecutive offline transaction, the card will:
Set the online requested by the card indicator as “1” to request that an ARQC
should be returned after card risk management is completed.
The card compares the transaction currency code and the application currency code.
If they are different, and if the consecutive offline transaction counter
(international-currency) plus 1 is more than the consecutive offline transactions
limit (international-currency), the card will:
UPI Confidential 72
PartII Debit/Credit Application Card Specification
The sum of the accumulated offline transaction amount and the authorized
amount is more than the accumulated offline transaction amount limit.
The check is optional. If the limit on the amount accumulated for consecutive
offline approved transactions performed in the application designated currency or a
second designated application currency has been exceeded, the card will request for
online authorization.
If the application currency code, the second application currency code, the currency
conversion factor, the accumulated offline transaction amount (dual currency) and
the accumulated offline transaction amount limit (double currencies) exist, the card
will perform the check.
If the transaction currency code equals to the application currency code, the
sum of the accumulated offline transaction amount (double currencies) and the
UPI Confidential 73
PartII Debit/Credit Application Card Specification
If the transaction currency code equals to the second application currency code,
the authorized amount shall be converted to the application currency code
amount at the currency conversion factor. The sum of the accumulated offline
transaction amount (double currencies) and the converted authorized amount
shall be compared with the accumulated offline transaction amount limit (dual
currency).
If the comparison result is that the limit is exceeded, the card will:
The check is optional. If the card is a new one, the transaction requests for online
authorization. New card refers to the one which has not been approved online.
If the last online ATC register and Application Default Action exist, the card will
perform the check.
Set the online requested by card indicator bit as “1” if “Online transaction for
new card” bit in ADA is “1”.
Note: if the card requests for mandatory execution of issuer authentication, the
ATC register value for the last online transaction shall always be zero unless the
issuer authentication is successful.
When the card supports offline PIN verification, this check is optional. If PIN try
limit has been exceeded during the last transaction, the transaction will request for
online processing.
If the check is to be performed, the Application Default Action (ADA) data shall be
present in the card.
UPI Confidential 74
PartII Debit/Credit Application Card Specification
Set “Offline Decline requested by card indicator bit” as “1” if “PIN try limit
exceeded on previous transaction, Decline transaction” in ADA equals ‘1’
Set online requested by card indicator bit as “1” if “PIN try limit exceeded on
previous transaction, go online” in ADA equals “1”
Decline the transaction and block the application if “PIN try limit exceeded on
previous transaction, decline and block application” in ADA equals “1”
The card responds to the GENERATE AC Command from the terminal based on
results of card risk management. Response of the card may override the cryptogram
type specified by Parameter P1 in GENERATE AC Command from the terminal.
The change shall comply with the following rules:
The card can override the decision of approve offline by the terminal to send
online or decline
The card can override the decision of sent online by the terminal to decline.
Card response
AAC ARQC TC
AAC Decline - -
Terminal
ARQC Decline Go Online -
request
If the offline decline requested by card indicator is “1”, it indicates that the card
decides to decline the transaction. If the online requested by card indicator is “1”, it
indicates that the card decides to send for online authorization.
The card sets the CVR to indicate that a TC (Offline approval), AAC (Offline
decline), or ARQC (go online for authorization) is to be returned in response to the
first GENERATE AC and that a second GENERATE AC has not been requested.
UPI Confidential 75
PartII Debit/Credit Application Card Specification
The card uses data provided by the terminal and data in the card to generate a
symmetric key algorithm based cryptogram. For detail data and algorithm required,
please refer to Appendix D.
When the transaction is declined offline, the card uses AAC to respond to
GENERATE AC Command. But before that, the card will:
If the ADA bit for If Transaction Declined Office, Create Advice = “1”,
set Advice Required to “1” in the Cryptogram Information Data (CID)
If the reason code in CID is not “service is not allowed”, set it into
“PIN tries are exceeded”
Note: In CID, the reason code “service is not allowed” is much superior to others.
Set SDA Failure indicator in the card as “1” if SDA Failure bit is “1”;
Set DDA Failure Indicator in the card as “1” if DDA Failure bit is “1” or
CDA Failure bit is “1”.
If the Terminal Country Code differs from the Issuer Country Code,
consecutive offline transaction counter (international-country) will be
increased by 1;
When the transaction is sent online for authorization, the card will use ARQC to
respond to GENERATE AC Command. Before responding, the card sets the Online
Authorization Indicator bit in the card as “1”.
UPI Confidential 76
PartII Debit/Credit Application Card Specification
If the Terminal Country Code differs from the Issuer Country Code,
Consecutive Offline Transaction Counter (international-country) is increased
by 1;
If the Transaction Currency Code differs from the Application Currency Code,
Consecutive Offline Transaction Counter (international-currency) is increased
by 1;
The card records the transaction details. The detailed contents will be
transmitted to the card through GET PROCESSING OPTIONS Command
during transaction initialization. For card transaction details, please refer to
Chapter16.
Card:
UPI Confidential 77
PartII Debit/Credit Application Card Specification
a) Set the Offline DDA Performed bit to “1” in the CVR. This step shall be
executed prior to the generation of Application Cryptogram in Step 1
UPI Confidential 78
PartII Debit/Credit Application Card Specification
Command:
GENERATE AC
A B
P1 indicates request cryptogram
type
Yes
Yes Yes
Yes
UPI Confidential 79
PartII Debit/Credit Application Card Specification
C D E
YES
YES YES
YES
Consecutive Consecutive
offline transaction offline transaction
Set ‘Velocity counter (international – counter (international
check on excess’ NO currency) +1 > – country) +1 >
NO Consecutive offline NO
bit in CVR = 1 Consecutive offline
transaction limit transaction limit
(international – (international –
currency)? country)?
NO
NO
YES YES
E F
UPI Confidential 80
PartII Debit/Credit Application Card Specification
F G
The
card performs The
transaction amount card performs transaction
amount (double NO
check in designated
currency? currencies) check?
YES YES
Transaction
Transaction Transaction
currency = second
currency=applicat NO currency =application NO application
ion currency? currency?
currency?
YES YES
YES
Accumulated
Accumulated transaction amount
transaction amount + (double currencies) + Use currency conversion
authorized amount > authorized amount > factor to convert into the
accumulated NO authorized amount in
accumulated transaction
transaction amount amount limit (double designated currency
limit? currencies)?
NO
Accumulated
YES transaction amount
YES (double currencies) +
YES authorized amount > NO
Set “Velocity check accumulated transaction
on excess” bit in CVR amount limit (double
=1 currencies)?
Set ‘Velocity check
on excess’ bit in
CVR = 1
NO
G
UPI Confidential 81
PartII Debit/Credit Application Card Specification
H I
YES YES
YES YES
NO
NO
NO
UPI Confidential 82
PartII Debit/Credit Application Card Specification
ADA
indicates “Notice shall be Set “Online Reset “Online
generated if the transaction authorization” authorization”
rejected offline”? indicator bit = 1 indicator bit
YES
YES
ADA indicates
“the transaction is rejected Respond to the 1st
and notice is generated as PIN NO GENERATE AC
try limit for the transaction Command L
is exceeded”?
NO GENERATE AC response
YES
Set “Notice is required” bit in
CID = 1 and the reason code is
“PIN try limit is exceeded”.
UPI Confidential 83
PartII Debit/Credit Application Card Specification
K L
Offline Offline
rejection acceptance
Transaction Transaction
currency code = NO currency code =
SDA in TVR fails? YES Set SDA failure application currency second application
indicator bit code? currency code?
YES YES
Add the Convert the
NO accumulated authorized amount
transaction amount with the currency
with the authorized conversion factor
amount
Transaction
currency code =
application currency
code?
NO
Consecutive offline
transaction counter
(international –
currency) puls 1
YES
Terminal
country code = issuer
country code?
NO
Consecutive offline
transaction counter
(international –
country) puls 1 YES
GENERATE AC response
The terminal reads CDOL1 data and Transaction Detail Short File Identifier (SFI)
from the card.
The terminal sends the first GENERATE AC Command to the card requesting for
cryptogram. The Command includes terminal data designated in CDOL1 which can
UPI Confidential 84
PartII Debit/Credit Application Card Specification
Online Processing
The terminal decides whether online authorization shall be performed based on the
cryptogram type returned to GENERATE Application Cryptogram Command.
Completion
If online authorization is requested while the terminal has no online capability, the
card will perform other kinds of risk management.
Some counters and indicator bits in the card will be reset based on Issuer
Authentication status and card option regarding Issuer Authentication.
UPI Confidential 85
PartII Debit/Credit Application Card Specification
13 Online Processing
Online Processing allows the issuer to check the transaction based on risk
management parameters in its host system and make transaction approval or
decline decisions. Besides traditional online check, the host authorization system
can use the dynamic cryptogram generated by the card to perform Online Card
Authentication and can consider transaction offline processing results in the
authorization decision.
Response of the issuer can include post-issuance updates to the card and a
cryptogram generated by the issuer. The card verifies the cryptogram to guarantee
that the response comes from a valid issuer. This validation is called Issuer
Authentication.
The table below specifies card data used by the terminal during Online Processing.
Application Cryptogram The online cryptogram (ARQC) value from the card.
Length indicator;
Issuer Application Data
Derivation key index (DKI);
The table below specifies the card data used by the terminal after it receives online
request.
UPI Confidential 86
PartII Debit/Credit Application Card Specification
The table below specifies the data applied by the card during issuer authentication.
Online response from the issuer to the terminal is specified in the table below. The
terminal uses EXTERNAL AUTHENTICATE Command to send the data to the
card for Issuer Authentication. Except for the data below, online response can also
include issuer Script data.
UPI Confidential 87
PartII Debit/Credit Application Card Specification
13.3 Command
13.4 Processing
After the terminal receives ARQC from the card and the terminal has online
capability, the terminal will send an online request. The online request includes the
data obtained by the terminal from the card during previous steps. During this stage,
the card has no processing.
The card does not conduct any steps during receiving the online response from the
issuer.
UPI Confidential 88
PartII Debit/Credit Application Card Specification
If AIP data in the card indicates that the card supports issuer authentication, and
online response received by the terminal includes issuer authentication data, the
terminal will issue an EXTERNAL AUTHENTICATE Command to the card.
2. Parse out the authorization response code from issuer authentication data and
store it for further application during completion processing function.
3. Use ARQC and the authorization response code generated for response to the
1st GENERATE AC Command to generate an Authorization Response
Cryptogram (ARPC). For key and algorithm for cryptogram generation, please
refer to Appendix D.
4. Compare the newly generated ARPC with the ARPC received from the
EXTERNAL AUTHENTICATE Command. If these two are the same, the
Issuer Authentication can be considered successful.
2. Set “Issuer Authentication Performed and Failed Indicator” bit in CVR as “1”;
The card shall ensure that the Issuer Authentication Failure Indicator remains set to
“1” when it is removed from the terminal after the completion of the transaction.
During the next transaction, the indicator bit shall be checked in the Card Action
Analysis to decide whether the transaction shall be sent online for authorization.
During completion processing, the card shall be able to check whether issuer
authentication is performed successfully since the response to the final
UPI Confidential 89
PartII Debit/Credit Application Card Specification
Card Terminal
1st EXTERNAL
AUTHENTICATE NO Respond 6985
Command?
YES
YES
Set “Issuer
authentication fails” Set “Issuer
indicator bit = 0 authentication fails”
indicator bit = 1
Set “Issuer
authentication is
Respond 9000 performed
unsuccessfully” bit in
=1
External authentication
Return command response The terminal
response to the receives
terminal response from
the card
Application Initialization
The card returns AIP to the terminal in the GET PROCESSING OPTIONS
command response. AIP indicates whether the card supports issuer authentication.
The card returns the Application Cryptogram in response to the 1st GENERATE
AC Command.
Completion
During completion, the card uses issuer authentication results to determine final
results of the transaction and reset some counters and indicators.
UPI Confidential 90
PartII Debit/Credit Application Card Specification
The terminal will send all issuer Script Commands included in the online response
to the card. The card may consider Issuer Authentication results in deciding
whether to apply issuer scripts
If the online authentication indicator bit indicates that online processing of the
previous transaction is not completed, the card will request online authorization for
this transaction.
UPI Confidential 91
PartII Debit/Credit Application Card Specification
14 Completion
The terminal and the card perform the following Completion steps to conclude the
transaction processing:
If online processing is requested, but the terminal does not support online or
online authorization is not completed, the terminal and the card perform
additional analysis to determine whether the transaction shall be approved or
declined;
Some counters and indicator bits will be set to record what has occurred during
transaction processing;
The table below specifies the data used by the card during Completion.
Application Default Action It is the indicator defined by the issuer to specify card
(ADA) actions under certain special circumstances.
Application Interchange Profile It includes the indicator bits that indicate the card supports
(AIP) Issuer Authentication.
UPI Confidential 92
PartII Debit/Credit Application Card Specification
Issuer country code (9F57) UnionPay dedicated data. It indicates country of the issuer.
UPI Confidential 93
PartII Debit/Credit Application Card Specification
ATC register for the last online It is the ATC value for the last online authorized
transaction transaction that meets Issuer Authentication requirements.
The table below specifies the response data used by the card during completion to
generate Application Cryptogram.
Cryptogram type:
Application transaction counter It is the transaction times counter initialized when the
(ATC) application is established on the card.
UPI Confidential 94
PartII Debit/Credit Application Card Specification
The table below specifies the card data used by the terminal during Completion.
The list specifies the data objects (tag and length) required
by the card from the terminal in the 2nd GENERATE AC
Command. Besides, the data tags required in Cryptogram
Algorithm, the following data must be applied in
transaction closing in CDOL2:
The table below specifies the terminal data used by the card during Completion.
UPI Confidential 95
PartII Debit/Credit Application Card Specification
Terminal Verification Results It is used to record the offline processing results, such as
(TVR) SDA failure or floor limit exceeded, etc.
Terminal country code It indicates the country where the terminal is located.
14.3 Command
The terminal sends the 2nd GENERATE AC Command to the card requesting for
the 2nd Application Cryptogram.
The card only performs Completion processing when the card requested an online
authorization during Card Action Analysis.
UPI Confidential 96
PartII Debit/Credit Application Card Specification
Request for offline approval or decline. For these transactions, card processing
is complete with Card Action Analysis. The card performs no Completion
processing.
Request for online authorization. Then the card shall perform Completion
processing for these transactions.
NO Authorization YES
Online authorization Online authorization
is completed response code = Y3 or Z3? is not completed
Authorization
NO response code = acceptance
code?
The
terminal or the card risk
NO YES
management requests for
Respond AAC AAC?
YES
The
card accepts
Accept or rejects the Reject Respond TC Respond AAC
transaction?
Respond TC
After the card receives the 2nd GENERATE AC Command, it performs Completion
processing. Based on the authorization response code type in the command,
Completion processing can be performed in two ways: online authorized
transaction (14.6) and request online operation, but online authorization is not
completed (14.7).
UPI Confidential 97
PartII Debit/Credit Application Card Specification
When the transaction was authorized online (Authorization response code is not Y3
or Z3), the card does the following:
Other values indicate that the issuer declines the transaction. And the
terminal needs to request for transaction decline.
When the card receives a request for an AAC in the 2nd GENERATE AC
Command or the authorization response code indicates an issuer decline, the card
shall return an AAC. But before that, the card will:
Set the bits in the CVR as 1 to indicate that an AAC is returned in The 2nd
GENERATE AC Command response;
Set “Issuer authentication not performed after online authorization” bit in CVR
as “1” if AIP indicates that issuer authentication is supported but not
performed;
Reset the following indicator bits if the issuer authentication is: (1) not
supported, or (2) optional but not performed, or (3) performed successfully:
UPI Confidential 98
PartII Debit/Credit Application Card Specification
When the card receives a request for a TC in the 2nd GENERATE AC Command,
and, if checked, the authorization response code indicates an issuer approval or
referral, the card will perform the following:
Set “Issuer authentication not performed after online authorization” bit in CVR
as “1” if AIP indicates that issuer authentication is supported but not
performed;
The card can decide whether to approve or decline the transaction based on
issuer authentication settings.
Card Approve - If any of the following conditions is satisfied, the card will
approve the transaction:
Issuer authentication failed, and ADA bit for “If Issuer Authentication
Performed and Failed, Decline Transaction” is set as “0”;
Issuer authentication is mandatory but not performed, and ADA bit for “If
Issuer Authentication is mandatory and no ARPC received, Decline
Transaction” is set as “0”.
UPI Confidential 99
PartII Debit/Credit Application Card Specification
The follow-up procedures for “card approves transaction” shall be performed. For
details, please refer to 14.6.2.1 Card Accepts Transaction after Receipt of TC
Request.
Card Decline - If any of the following conditions is satisfied, the card will
decline the transaction:
Issuer authentication failed, and the ADA bit for “If Issuer authentication
Performed and Failed, Decline Transaction” is set as “1”;
Issuer authentication is mandatory but not performed, and the ADA bit for
“If Issuer Authentication is mandatory and no ARPC, Decline
Transaction” is set as “1”.
The follow-up procedures for “card declines transaction” shall be performed. For
details, please refer to 14.6.2.2 Card Rejects Transaction after Receipt of TC
Request.
1. Set the bits in the CVR as 1 to indicate that a TC is being returned in The 2nd
GENERATE AC response
Change value of the ATC register for the previous online transaction
into ATC of the current transaction.
5. The card records the transaction details. The contents will be transmitted to the
card through GET PROCESSING OPTIONS Command during transaction
initialization stage. For descriptions on card transaction details, please refer to
Chapter 19.
When the card has declined the transaction where an approval was requested, it
will:
Set the bits in the CVR as 1 to indicate that an AAC is being returned in the 2nd
GENERATE AC response
Set “Advice required” bit in CID as “1” if the ADA bit for “If Transaction
Declined Because Issuer Authentication failed or Not Performed, Create
Advice” is set as 1
Perform the optional card risk management which are supported; refer to
14.7.1 Card Risk Management;
Respond to the terminal; refer to 14.7.2 Card Response after the Transaction
cannot be sent Online.
Card Risk Management includes optional checks to determine whether the times of
consecutive offline transactions has exceeded upper limit of consecutive offline
transactions, whether accumulated amount of consecutive offline transactions has
exceeded the limit, whether the card is a new one, and whether PIN try limit has
been exceeded during the previous transaction.
When online authorization was not completed, even if the terminal requests
transaction decline (AAC) in the 2nd GENERATE AC Command or the card
decides to decline the transaction during previous risk management, the card will
still perform all card risk management supported. As the card performs all checks,
the order in which the checks are performed need not conform to the order
described below.
The check is optional. The aim is to check whether the times of consecutive offline
transaction exceed the maximum limit.
If ATC register of the last online transaction and UnionPay dedicated data - Upper
limit of consecutive offline transaction (tag “9F59”) exist, the card will perform the
check.
If the difference between ATC and last online ATC register exceeds upper limit for
consecutive offline transactions, the card will:
Set “Offline Declined requested by card indicator” bit as “1” to indicate that an
AAC should be returned after completion of card risk management.
The check is optional. The aim is to check whether the card has any transaction
approved online before.
If ATC register of the last online transaction does exist in the card, the card will
perform the check. If ADA does not exist, the card will take the default value
“0”.
If ATC register for the last online transaction is zero, the card will:
If the ‘ADA bit for IF New Card, Decline if Unable to Transmit Online’ is set
as ‘1’, the card sets the ‘offline Decline Requested by Card’ Indicator to ‘1’ to
indicate that an AAC should be returned after completion of card risk
management.
This check is optional. The aim is to check whether PIN try limit has been
exceeded during previous transactions.
If the ADA is not present, the card will take ADA as default value of zero.
If the card supports offline PIN verification, and the card has not received VERIFY
Command from the terminal during the current transaction, the card will:
If PIN try counter is zero and the ADA bit for ‘if PIN Try Limit Exceeded on
Previous Transaction, Decline If Unable to Transmit Transaction Online (Byte
2 bit 5)’ is set as ‘1’
The check is optional. The aim is to check whether the accumulated amount of
consecutive offline transaction in the primary currency exceeds the upper limit or
not.
If accumulated offline transaction amount and upper limit for accumulated offline
transaction amount exist, the card will perform the check.
If the sum of accumulated offline transaction amount and authorized amount of the
current transaction is more than the upper limit of accumulated offline transaction
amount,
The check is optional. The aim is to check whether the accumulated amount of
consecutive offline transaction in designated currency and second application
currency exceeds the upper limit or not.
If the sum of accumulated offline transaction amount and authorized amount of the
transaction (for second application currency, the amount shall be converted with the
currency conversion factor at first) is more than the upper limit of accumulated
offline transaction amount,
Based on the application cryptogram type requested by the terminal and card risk
management results, the card will respond to the 2nd GENERATE AC Command
issued by the terminal as follows.
If any of the following conditions is satisfied, the card will decline the transaction:
The result of card risk management is that the “Offline Decline Requested by
Card indicator” bit as “1”
For transaction decline processing, please refer to 14.7.2.1 Card decline the
Transaction after unable to go Online.
If all the following conditions are met, the card will approve the transaction:
The result of card risk management is that the “Offline Decline Requested by
Card indicator” bit as “1”.
For transaction approve processing, please refer to 14.7.2.2 Card Approves the
Transaction after Unable to Go Online.
This section describes how the card declines the transaction when online processing
is requested for the transaction but online authorization is not able to be completed
(authorization response code is Y3 or Z3). The card will:
Set SDA failure indicator bit as “1” if “SDA failure” bit in TVR is “1”;
Set DDA failure indicator bit as “1” if “DDA failure” bit in TVR is “1”;
Set CDA failure indicator bit as “1” if “CDA failure” bit in TVR is “1”;
Keep the value of ATC register for the last online transaction the same;
This section describes how the card approves the transaction when online
processing is requested for the transaction but online authorization is not able to be
completed (authorization response code is Y3 or Z3). The card will:
If the transaction currency code differs from the application currency code,
Add the accumulated offline transaction amount (dual currencies) with the
converted authorized amount if transaction currency code is the same as the
second application currency code;
Keep value of ATC register for the last online transaction the same;
If any of the following situations occurs, the card will perform CDA:
CDOL2 in the card includes terminal capability data tags, and the terminal
capability data from the terminal and Application Interchange Profile (AIP) in
the card both indicate that CDA is supported.
CDOL2 in the card does not include terminal capability data tags, and
Parameter P1 in GENERATE AC Command from the terminal has a CDA bit
of “1”.
3. Use IC card private key to sign the application cryptogram responded by the
card as the signed dynamic application data if the card responds TC. The
procedures are as follows:
Use IC card private key to sign the signed dynamic application data.
The figures below are flow charts for the card to perform Completion processing.
The
Authentication transaction
response code = Y3 or Y can not get
Z3? online
Issuer
authentication
supported?
Y
N
Issuer
authentication
succeeded?
Issuer
Y authentication
Y N optional?
Reset to zero:
- Online authorization indicator bit;
- SDA failure indicator bit; N
- DDA failure indicator bit;
- Issuer script command counter;
- Issuer Script failure indicator bit.
Set Issuer authentication
failure indicator bit
online
accepta Authentication response
nce code is not Y3 or Z3,
and TC is requested
Issuer Card
authentication NO accepts
supported?
YES
Issuer
authentication
performed?
NO
Issuer Card
authentication YES accepts
optional?
NO
Set “Issuer
authentication
failure” indicator bit
=1
YES
“The transaction
is rejected as issuer Card
authentication is mandatory NO accepts
but ARPC is not received”
bit in ADA = 1?
YES
Card
rejects
NO
NO
Card
accepts
Card Card
accepts rejects
Issuer
authentication NO
supported?
YES YES
Set “Notice is
required” NO
Issuer indicator bit in
CID as 1
authentication NO
succeeded?
YES
Generate
cryptogram
G
Corresponding
command
Authorization
response code
indicates that the The card supports
transaction can not offline PIN?
get online
YES
ATC – ATC
register of the last online
transaction > Upper limit of
consecutive offline The card receives
transaction? VERIFY Command? YES
NO NO
ATC
register of the last
online transaction
= 0? Set “Can not be
forwarded online” bit
in CVR = 1
YES
YES
Offline rejection
Can not
get
online
Set “The 2nd
GENERATE
AC Command”
bit in CVR
NO
Transaction Increase offline
currency code transaction
= application NO counter TVR
currency (international – indicates Set DDA failure
country) by 1 that DDA YES indicator bit = 1
code? fails?
YES
YES NO
The
terminal YES “Notice
requests for is required if the
AAC? transaction is rejected”
bit in ADA = 1?
NO
“Card YES
requests
rejection”
indicator bit Set “Notice is
= 1? required” bit in NO
CID
Offline
NO approval
Transaction
currency code = Convert the authorized
YES amount with the currency
application currency conversion factor
code?
Add accumulated
transaction amount
(double currencies)
NO with converted Generate
authorized amount Application
cryptogram
nd
Set “The 2
GENERATE AC
Command returns TC”
bit in CVR The card
responds to the
2nd
GENERATE
Set cryptogram AC Command
type in CID
Transaction Detail File Short File Identifier is read from the card.
Online Processing
On the following transaction, the card will use counters and indicator bits set
during Completion to make decisions and perform checks.
The table below specifies the counters and indicator used by the card during Issuer
–to-Card Script Processing.
The table below specifies the terminal data used during Issuer-to-Card script
processing.
Terminal Validation Results (TVR) - Issuer script failed after the final GENERATE
Application Cryptogram Command.
Keys in issuer script operations include Master Message Authentication key and
Master Message Encryption key.
For details, please refer to the UnionPay Integrated Circuit Card Specifications -
Basic Specifications Part4: Debit/Credit Application Security Specification.
ATC
Issuer authentication system
- Use MAC MDK, PAN and PAN
sequence No. to calculate MAC UDK;
In transaction The card uses MAC - Use MAC UDK and ATC to calculate
UDK to generate MAC session key;
MAC session key - Generate Script Command MAC.
The figure below illustrates the generation and use of Master data Encipherment
DEA key.
The table below specifies the issuer script data in the authorization response if
Issuer-to-Card Script Processing is to occur.
15.5 Command
The following functions are the ones that can be performed during Issuer-to-Card
script processing. It is recommended to use Issuer Script Command to process these
functions. For detailed encoding of the commands, please refer to Appendix B.
Except for CARD BLOCK Command, all the commands are applicable to the
current selected application.
APPLICATION BLOCK
If the issuer determines that the current application in use should be invalidated,
APPLICATION BLOCK function will be performed. The application block now
can be unblocked by the issuer subsequently.
If the application is blocked during transaction, the terminal and the card will allow
the transactions to be executed further until the Completion. However, for the
subsequent transactions, the card does not allow blocked applications to be selected
for Financial Transaction (the terminal may select a blocked application for
APPLICATION UNBLOCK
CARD BLOCK
CARD BLOCK Command makes all applications on the card invalid and makes
the card power-off. Unless a card is blocked, Payment System Environment (PSE)
shall always be valid and can be accessed.
If the card is blocked during transaction processing, the card and the terminal will
allow the transaction to proceed till Completion. A blocked card cannot be
unblocked with Issuer script Command or other commands. Therefore, the card is
essentially disabled. If the card is blocked, the PSE shall be invalid. The card will
respond “Function not supported” (SW1/2 = “6A81”) to SELECT Command. The
card will not allow any other form of application selection such as implicit
selection.
When the issuer decides to disable any functions of the card, CARD BLOCK can
be performed. Such as lost card or stolen card. After the card is blocked,
applications on the card cannot be unblocked.
The CARD BLOCK Command in issuer Script is used to realize the function of
blocking the card.
If PIN value needs to be changed, PIN data shall be encrypted with symmetric
algorithm. For descriptions on algorithm, please refer to 18.6.3 Card Secure
Messaging. When PIN value is changed, the PIN try counter will be automatically
reset to PIN try limit.
PIN change must be performed under a secure environment under the issuer’s
control.
PUT DATA
The PUT DATA command allows specific primitive data objects in the card to be
updated. A data object can be updated with this command only if it has a tag
associated with it.
According to the Specification of this version, the following data can be changed
through PUT DATA Command. A proprietary internal file shall always be used for
these data elements:
UPDATE RECORD
15.6 Processing
Tag “72” in the authorization response message indicates after the 2nd GENERATE
AC Command, issuer script processing is to be performed. One Script can include
multiple commands.
Commands that are used to change or reset card contents must be reported in
messages. Please refer to 15.6.3.
As the card cannot recognize whether the command is an Issuer script command or
any other command, the card cannot reject any command sent before the 2nd
GENERATE Application Cryptogram Command.
15.6.4 Result Indicator describes the UnionPay dedicated indicator bit in the card
which records the status of issuer script command received after the 2nd
GENERATE AC Command.
The card shall not reject an Issuer script because Issuer authentication is not
performed. If Issuer authentication is performed but failed, then the card shall reject
the Issuer script command. In this situation, the recommended response to an Issuer
script command is “6985”.
Before executing an Issuer script command, the card uses secure messaging to
authenticate the issuer. If Card receives Script Commands of secure messaging
checking failure, status code “6985” will be returned, while the subsequent Script
Command will not be executed. During script processing, issuer authentication
method which is described in the online processing is not performed.
The basic purpose to use secure messaging is to guarantee the data confidentiality
and information Integrity and authenticate the issuer. Information Integrity and
issuer authentication can be based on MAC. Data confidentiality can be guaranteed
based on encrypted data, such as PIN encryption.
MAC is calculated from all the data in the Command, including head of the
Command. Data encryption (if necessary) shall be performed before MAC is
generated.
The card uses the Issuer Script Command counter to record quantity of commands
with secure messaging received after the 2nd GENERATE AC Command.
When the card processes the commands received after the 2nd GENERATE AC
Command, the card shall set issuer Script failure indicator bit as “1” if any of the
following errors occurs:
Failure of card processing for a command that does not require secure messaging
shall not impact this indicator
The figure below illustrates how the card processes each command during
Issuer-to-Card script Processing.
Card Terminal
The card
receives Script Command
Command sent
by the terminal
Secure
Secure Messaging
Messaging? NO required for the
Command? NO
YES
Increase Script
Command
counter by 1 Command
processing
Use MAC
UDK and
ATC to
generate MAC
session key
MAC
effective?
YES
YES
Encrypted
Data is
decrypted
NO
Command
executed
successfully
?
Command response
YES The card returns the
command response.
Online Processing
Completion
If the online responses received by the terminal include issuer script, Issuer-to-Card
script processing shall be performed after the Completion processing.
The card will set Bit 8 – 5 of Byte 4 in CVR as issuer Script Command
counter;
If the issuer Script Processing failure indicator bit is “1”, the card will set
“Issuer script processing for the last transaction fails” bit in CVR as “1”.
After an online transaction, if any of the following conditions is met, Issuer Script
failure indicator bit and issuer Script counter will be reset as “0”:
During Card Risk Analysis and Completion, the card shall record transaction
details before deciding to approve the transaction and return TC,.
Transaction detail record file is a circulating record file with a fixed length. The
record format excludes application elementary data template (tag ‘70’). Short File
Identifier and record quantity of the record file are specified in the data element of
log entry (tag ‘9F4D’). Short File Identifier of transaction detail record file must be
within the scope of 11-30. The recommendation under This Specification is 11.
Log entry data element is returned in the issuer dedicated data from the card when
application is selected.
Record contents are decided by the log format (tag ‘9F4F’). Range of log format is
a series of tags and lengths of data objects of the log contents. The terminal obtains
log format data element through Get Data Command so that the contents to be
recorded in transaction detail record file is clear.
Log format and transaction log records can still be accessed even after the
application is blocked.
In order to read transaction log information, specific devices shall use the following
procedures:
To perform application selection and obtain log entry data element from issuer
custom data. If log entry data element does not exist, the application will not
support transaction log function.
Log entry data element content has a tag of ’0B0A’. SFI of the transaction detail
files is 11. The quantity of records is 10.
Log format data element specifies the tags and lengths of data objects defined in the
table below.
Terminal date 9A 3
Terminal type 9C 1
The terminal can transmit the terminal data element in transaction details through
PDOL or CDOL to the card.
If the issuer does not establish Transaction Detail files when it issues the card, but
log entry data element is included in the response to application selection, then the
card still cannot record transaction details.
The card can only record transaction details when the card responds TC to the last
GENERATE AC Command. For one transaction, transaction details can only be
recorded at most once.
For added data elements on the basis of debit/credit application, please refer to table 46: Card
Data Elements and table 47: Terminal Data Elements.
——Electronic Cash Balance:This data element saves the available amount of the total amount
for offline transactions. For each successful Low-value payment transaction, the
corresponding authorized amount will be subtracted. Once the authorized amount exceeds
the Electronic Cash Balance, the transaction will be processed according to the standard
debit/credit.
——Electronic Cash Balance Limit: it means the maximum cumulative limit that the cardholder
may use for offline transactions in the electronic cash application, or the upper limit that may be
reached by recharging the card. The Issuer may revise the upper limit;
——Electronic Cash Issuer Authorization Code: the code on the card used for marking the approved
electronic cash transaction. In an offline approved transaction, the code is stored in the
authorization code of clearing message, in the format of “ECCxxx” of which “xxx” stands
for the number defined by the Issuer;
——Electronic Cash Single Transaction Limit: the upper limit of the authorized amount for one
single electronic cash transaction on a card, for controlling the risk of single electronic cash
transaction. It is written by the Issuer during personalization and can be reset by the Issuer;
——Electronic Cash Reset Threshold: lower available balance limit to activate the card to perform
automatic load. When the offline available balance on a card is lower than the threshold, the
card should request online processing and initiate loading automatically.
——Electronic Cash Terminal Support Indicator: Indicating that the terminal to support
electronic cash processing
——Electronic Cash Terminal Transaction Limit: the terminal uses the data element (if any) to
decide whether the transaction is performed in the electronic cash mode. If the data element is
present, the transaction is not an electronic cash transaction when the authorized amount is
higher than that limit; if the data element is absent, the transaction is not an electronic cash
transaction when the authorized amount is higher than the terminal floor limit.
For the description of Card offline data authentication, please refer to Part IV.
The Issuer should adopt the powerful CAM mechanism to prevent the risk of offline fraud.
For instance, the card may be set to allow the offline transaction only under the
circumstance of executing Dynamic Data Authentication (DDA) or Combined DDA/AC
Generation (CDA). AIP shall be contained in SDA signature.
——To facilitate offline processing, online PIN should not be set as preferred CVM.
The low-value payment function adopts the same method as debit/credit to record
transaction log. Please refer to section 16.
Electronic Cash Balance refers to the available value for offline transactions which is
calculated in terms of application currency. Low-value payment function does not permit
supporting currency conversion either through the card or the terminal because Electronic
Cash Balance must reflect the available amount for transactions accurately, however the
currency conversion may lead to the fact that an inaccurate amount of Electronic Cash
Balance may be saved in the card.
As described in section 17.1.1, three card data elements which are Electronic Cash Balance,
Electronic Cash Balance Limit and Electronic Cash Single Transaction Limit, are added in
the low-value payment function, for controlling the offline risk of the Issuer.
The Issuer may change the card behavior in accordance with the threshold value of the
offline counter. Card risk management uses these thresholds according to the following
principles:
——If the authorized amount is lower than the Electronic Cash Balance and the Electronic
Cash Single Transaction Limit, the card should approve offline transaction;
——When the authorized amount exceeds the Electronic Cash Balance or the Electronic
Cash Single Transaction Limit, the standard debit/credit flow should be processed.
The Issuer may grant the online authorization to a transaction according to the primary
account balance of the cardholder. The Issuer may conduct loading by the way of script to
adjust the value of Electronic Cash Balance, and the script will be processed by Issuer as
standard debit/credit process.
The Load Log is a separate Log from the Transaction Log, recorded and stored by the card.
When the Electronic Cash Balance (9F79) on the card is successfully rewritten by the Put
Data Command, one record will be recorded into Load log by Card.
The recording and cyclic covering of the Transaction Log should not affect the Load Log
and vice versa.
The Load Log recording and Put Data Command should be successfully performed in the
same time. If one of them fails, another action should be also failed.
The Load Log record document is a circulating record file with a fixed length. Its SFI and
Record Number are stipulated by the Load log Entry Data Element (Tag "DF4D"). The SFI
value of the Load Log record document should be between 11-30, and should not repeat
the other documents defined in this specification. UnionPay Integrated Circuit Card
Specifications - Basic Specifications recommends the SFI value of the Load Log to be 12,
and the Load Log entry data element should come back from BF0C template of the FCI of
the ADF in the card, when selecting its application.
Load Log Format (Tag "DF4F") and Load Log record should still be available for visit
after locking the applications.
Ways of reading the Load Log include reading one by one and reading disposable all Load
Log messages: the cardholder and the Issuer may inquire Loading details using one-by-one
reading; one-off reading of all Load messages may be applicable on automatic facilities, or
the acquisition of Issuer counter of the entire Load Log protected by MAC, providing
reference when there is an account error. The two ways of reading use the following
procedures:
One-by-one reading:
——Executing application selection: To get Load Log Entry Data element from the
custom data of FCI's Issuer. If the Load Log entry data element does not exist, it means
that the application does not support the Load Log Function.
——Send a Get Data command to get Load Log format data element;
——Send Read Record (P1 = Record Number) command to read Load Log record
——Executing applicable choice, to get Load Log data element from the FCI Issuer
custom data. If the Load Log data element does not exist, it means that the application does
not support the function of Load Log.
——Send a Read Record command (P1=00) to read the Load Log record.
There is no restriction on reading permission of the Load Log record. Writing permission
is not enable and is controlled by the card operational system.
The term “Balance" is not used to indicate that a card contains any currency. It indicates
the maximum offline payable amount promised by the Issuer to a merchant. In addition to
Electronic Cash Balance, there may be other balances with different values:
The Issuer should provide the corresponding training for cardholders to make them aware
that different available balances for purchases may be caused under different
circumstances.
The terminal sends SELECT command to select the application, and the card returns the
file control (FCI) information, including PDOL which contains Electronic Cash Terminal
Support Indicator, authorized amount and transaction currency code.
——The authorized amount is lower than Electronic Cash Terminal Transaction Limit, or
lower than the terminal floor limit if the terminal does not contain the independent
Electronic Cash Terminal Transaction Limit;
As a result, the terminal will provide in GPO command Electronic Cash Terminal Support
Indicator (set as “1”).
When receiving GPO command, the card will take the transaction as a low-value payment
transaction if the following conditions are met:
——the command includes the electronic cash terminal support indicator (set as "1");
——the transaction currency code matches with the application currency code;
——the authorized amount should not exceed the electronic cash balance;
——the authorized amount should not exceed the electronic cash single transaction limit;
——the script processing error indicator of the last online transaction of the Issuer is "0";
If one of the above criteria is not satisfied, the transaction is not considered as a low-value
payment transaction.
——Return GPO response data AIP and AFL. AIP refers to the functions supported by
low-value payment transaction. AFL indicates the specific data of low-value payment
transaction -- the location of the electronic cash Issuer authorization code.
If the transaction is not a low-value payment transaction, the card returns non-low-value
payment (debit/credit) AIP and AFL in the response to GPO (not returning Electronic Cash
Issuer Authorization Code), the terminal will process this transaction as standard
debit/credit transaction.
If the terminal receives the AIP and AFL, and the electronic cash Issuer authorization code
exists, it reads the following data with the GET DATA command:
If the terminal does not receive the AIP and AFL, the transaction will be terminated.
The terminal does not perform the floor limit, random transaction selection and velocity
checking.
The terminal reads data from the AFL that returns from the card, and compares the
difference between Electronic Cash balance and the authorized amount with the Electronic
Cash Reset Threshold; meanwhile, it performs the terminal action analysis in combination
with the terminal capacity.
——If the value from Electronic Cash Balance minus authorized amount is higher than or
equal to Electronic Cash Reset Threshold, it will request the offline approval from the card
to continue the low-value payment transaction;
——If the value from Electronic Cash Balance minus authorized amount is lower than
Electronic Cash Reset Threshold, it will determine the following decisions according to the
terminal capacity:
If the terminal has an online capacity, it will request the online processing and require
the cardholder to enter an online PIN; and this transaction requests to the Issuer and get the
online authorization with updating the Electronic Cash Balance;
If the terminal does not have an online capacity, the terminal will request offline
approval, so that this transaction may be completed with an offline mode.
If the terminal fails during an online processing, the terminal and the card will
continue performing the standard debit/credit transaction.
——If the terminal declines the transaction offline (requests an AAC), the card will return
AAC in the response to the command of GENERATE AC;
——If the terminal requests online transaction, the card will return ARQC in the response
to the GENERATE AC command;
——If the terminal requests offline approval, the card should check whether the tag
provided by the terminal in the GENERATE AC command matches the tag provided by
the GPO command (these tags exclude terminal verification result '95', transaction status
message '9B' and the unpredictable number '9F37' but include others besides transaction
currency code '5F2A', authorized amount '9F02', but does not include). If the checking
results are matched with each other, the card will deduct the authorized amount from
Electronic Cash balance and return TC in response to the GENERATE AC command,
otherwise the card will return AAC in response to GENERATE AC command;
——Return updated Electronic Cash Balance in Issuer Defined Data (IDD) (please see
Table 3) of issuer application data (Tag 9F10)..
——The result of electronic cash transaction will not affect the values of various counters
in the standard debit/credit (except for ATC).
In the transaction completion, Both Electronic Cash Balance is shown to the cardholder by
the terminal and printed on the receipt should be obtained from the IDD of the Issuer
applicable data (9F10) that the card returns in response to the GAC data. Please refer to
Table 48 for the format of IDD. If Electronic Cash Balance is not included in the IDD, the
terminal should follow the procedures in the appendix H which gets Electronic Cash
Balance.
After completing the transaction, the terminal will collect the transaction data and send the
transaction details to the Acquirer on the same day to perform the subsequent clearing. The
terminal should provide Electronic Cash Issuer Authorization Code in the authorization
code of clearing message. The Electronic Cash Balance that the card sends to the terminal
may be printed on the transaction receipt.
When receiving the transaction data for clearing, the Issuer may identify whether it is a
low-value payment transaction. If yes, it will deduct the corresponding transaction amount
from the electronic cash account (rather than the cardholder primary account).
The data for verification number calculation include 2-byte application transaction counter,
available Electronic Cash Balance and 1-byte 0x00 bit padding rightmost.
A 4-byte verification number is obtained by calculating the session key from MAC UDK
derivation. The methods of key derivation and MAC calculation are defined in Part VII of
This Specifications.
The Issuer-Defined Data (IDD) is determined by the issuer during the card personalization
processing, for definition of IDD and other definitions, please refer to Part V Appendix D.
ATC 2 bytes
0x01 8-bit bytes Electronic Cash Balance available Low 5-bit bytes
Padding 1 byte
Terminal Card
Returns PDOL, requesting EC
Select all AID to Terminal Supporting Indicator,
Select Command
be used Authorized Amount and Transaction
Select Response
Currency Code
Transaction
Type =
Purchase? EC Terminal Supporting
Indicator is ‘1’?
Yes No
Yes
Terminal
No
Supports EC? Transaction Currency Code=
Application Currency Code? No
Yes
Yes
EC Issuer
authorization GPO Response
code present? Indicates
transaction as EC
Yes
Obtain EA Balance No
and EA Reset Value Terminal AIP = EC AIP
by GET DATA terminates AFL = EC AFL
transaction (EC AFL contains AIP = CUPIC AIP
file No. containing AFL = CUPIC AFL
Offline data EC Issuer Auth
authentication Code)
Terminal Risk
Management
Terminal Card
NO
Is the transaction
Terminal Action Analysis as EC transaction?
Standard CUPIC
TC Yes flow processed
Yes No
Cryptogram Returns TC in
Cryptogram Type Cryptogram Type GENERATE AC
Type requested
requested is ARQC requested is ACC Response
is TC
Returns updated
EC Balance in IDD
of ‘9F10’
Terminal completes
GENERATE AC GENERATE AC
standard transaction
Response Response
processing flow
This chapter describes in details the common commands are used to control the financial
IC card with low-value payment function:
The command regarding Electronic Cash Balance allows the terminal to read the available
offline transactions amount from the card directly. The Electronic Cash Balance is
obtained with the GET DATA command.
Please refer to Table 50 and Table 51 for the data format of the command and its response.
CLA “80”
INS “CA”
P1 “9F”
"9F79" is the tag for Electronic Cash Balance data
element
P2 “79”
LC N/A
Data N/A
Le “00”
Electronic Cash Balance should be represented in the currency defined in the application.
The command regarding the transaction log allows the terminal to access the records stored
in the card transaction log, and such records should be read with the READ RECORD
command.
Please refer to Table 52 and Table 53 for the data format of that command.
CLA “00”
INS “B2”
P1 Record Number
Please see the structure table in P1 and P2
P2 Reference Control Parameter
Le “00”
Please refer to Table 53 for the values of P1 and P2 parameter fields in the command of
READ RECORD.
00: to acquire all the record from the Load Log in the card
on one go, and the record content it returns to goes through
MAC to ensure record entirety.
P1 1~8 Record Number
Record Number: From 1 to the maximum Record Number
supported by the application (the minimum is 10). The actual
size is defined in the FCI.
P1 is the Record
3 1
P2 Number
2 Not used 0
1 Not used 0
The sequence of each data element in the Transaction Log is defined by Transaction Log
format (9F4F). The recommended value of the format can be detected in Table 45. The
sequence of each data element in the Load Log is defined in Table 54. When recording on
the Load Log, the Basic Data Templates (Tag "70") should not be included, the tag and
length of the data element are also not required, only the value is needed to be recorded.
The Transaction Log format (DF4F) should be retrieved through GET DATA command.
No. 1-4 in Table 54 are the fixed content in the Load Log, and no. 5 is the variable content
in the Load Log but that value can be defined by the issuer. For recommended value,
please refer to Table 55.
5 Value of Data Element defined in the Load Log format (DF4F) (See var.
Table 55)
Remark: For definition of DF79 in Table 54, please refer to "Low-value Payment
Specification Based on Debit/Credit Application)
9A Transaction Date 3
The latest transaction is stored in record 1, the second latest transaction is stored in record
2, and so on with the same rule.
If the terminal tries to read an empty record, the card returns an error (SW1SW2 = "6A83").
Empty record may be reflected in the following situations:
——There is no transaction record in the Log (in case it is a new issued card);
——P1 is larger than the maximum record number (the maximum record number refers to
the maximum number of records in the current card transaction detail record).
——In order to read full contents in the transaction log, the terminal should start from
Record 1 to execute all READ RECORD commands until the card responds to
SW1SW2=“6A83”, it indicates that the last item of log has been read1.
In order to correctly explain the data in the transaction log, the terminal needs to know its
data formats. The formats are defined in File Control Information (FCI). The transaction
log formats are read by using the commands in Table 56.
CLA “80”
INS “CA”
P1 “9F”
"9F4F" is the data tag for log formats
P2 “4F”
Le “00”
1
The storage size of the transaction log is depended on the issuer.
Response data belong to the transaction log, and the log formats will be encoded in a
manner similar to DOL (data object list). Please refer to Table 9 for the data element
format.
The Electronic Cash Parameters on the card can be updated by the PUT DATA command
in Chapter 2. The Issuer host should create and send such command in the form of a script
during the authorization response. There are four card electronic cash parameters that can
be updated through the script command which are Electronic Cash Balance, Electronic
Cash Balance Limit, Electronic Cash Single Transaction Limit and Electronic Cash Reset
Threshold. Please update the Electronic Cash parameters by using the command format in
Table 57 and58
CLA “04”
INS “DA”
P1
P1 and P2 are the tags of EC parameters
P2
LC “0A”
Le “00”
EC Balance 9F 79
EC Balance Limit 9F 77
EC Reset Threshold 9F 6D
The response status code for successful update is SW1SW2="9000", the status of other
possible errors are defined in the regulations in Chapter 2.
Table A.1 lists the card and issuer data elements in This Specification, including
format (F), tag (T) and length (L).
n (numeric);
cn (compress numeric);
b (binary);
an (alphanumeric);
If the defined length exceeds actual length of the data but not all the bits are
occupied, the remaining bits shall be applied with the following rules:
Data element in format ans shall be left-justified and padded with trailing
hexadecimal zeros.
R (Required): The data element must be present. The terminal will not check
the data during the process of Read Application Data.
When data is moved from one entity to another (for example, card to terminal),
it shall always be passed in order from high order to low order, regardless of
how it is internally stored. The same rules apply when concatenating data.
Name (format;
Requirement Descriptions Value
tag; length)
Byte 2:
bits 8–7:
00 = 2nd GENERATE AC
returns AAC;
01 = 2nd GENERATE AC
returns TC;
10 = 2nd GENERATE AC is
not requested.
11 = RFU
bits 6–5:
00 = 1st GENERATE AC
returns AAC;
Card UnionPay dedicated
Verification data. 01 = 1st GENERATE AC
Results Returns TC;
It indicates the exception
(CVR) conditions that occurred 10 = 1st GENERATE AC
M in the current and returns ARQC;
F: b 32 previous transactions. It
11 = Cannot return 11;
T: – is returned to the
terminal in the Issuer bit 4: 1 = Issuer
L: 4. Application Data. authentication performed
and failed;
Byte 3:
Name (format;
Requirement Descriptions Value
tag; length)
bit 4: 1 = Issuer
authentication for the last
online transaction fails;
Byte 4:
Name (format;
Requirement Descriptions Value
tag; length)
T: – declined offline
L: –
Consecutive
Offline UnionPay dedicated data
Transaction C element.
Counter The initial value is 0. For
If velocity It records the times of each time of completing an
(international-c
check is to be offline transactions international-currency offline
urrency)
performed on without using the transaction, it is increased by
F: b 8 international - designated application 1.
currency currency since the last
T: –
online transaction.
L: 1
Consecutive
offline
UnionPay dedicated data
transaction C
element. The initial value is 0. For
counter
If velocity each time of completing
(international-c It records the times of
check is to be international-country offline
ountry) offline transactions
performed on transaction, it shall be
performed beyond the
F: b 8 international - increased by 1.
issuer’s country since the
country
T: – last online transaction.
L: 1
UnionPay dedicated
Cryptogram
data.
Version Number
It indicates version of UnionPay specifies that
F: n2 R cryptogram version number is
the algorithm used to
T: – generate the cryptogram. 01 (’01’).
It is transmitted in the
L: 1
issuer application data.
UnionPay dedicated
Accumulated C The initial value is 0. It adds
data.
offline the authorized amounts for
transaction If velocity It records the each completed offline
amount check on accumulated offline transaction in the application
accumulated transaction amount in the designated currency. Reset to
F: n 12 amount is to be application dedicated zero after certain online
T: – performed. currency since the last transactions.
completed online
Name (format;
Requirement Descriptions Value
tag; length)
L: 6 transaction
UnionPay dedicated
Accumulated
C data. The initial value is 0. It adds
offline
transaction If velocity It records the the authorized amounts for
amount (dual check on accumulated offline each completed offline
currencies) accumulated transaction amount in the transaction in the application
amount (dual application designated designated currency and the
F: n 12 second application currency.
currencies) is currency and the second
T: – to be application currency Reset to zero after certain
performed. since the last completed online transactions.
L: 6
online transaction
UnionPay dedicated
Message
data.
Authentication Message Authentication
Code(MAC) C Double length Message Code(MAC) DEA key
DEA key Authentication Code
If PIN F: b 128
(MAC) key, 16bytes. It
F: b 128 modification is
is used to calculate MAC T: -
performed
T: - when secure massaging
L: 16
is required by issuer
L: 16
script.
UnionPay dedicated
data.
It is used to identify to
Derivation key the issuer the appropriate
index (DKI) issuer’s derivation key to
derive the card’s unique It is assigned by the issuer.
F: b 8 O DEA keys for online If it does not present, the
T: – card and issuer default value is zero.
authentication. (The DKI
L: 1 is not used by the card).
It is returned to the
terminal in the issuer
application data.
Name (format;
Requirement Descriptions Value
tag; length)
Name (format;
Requirement Descriptions Value
tag; length)
UnionPay dedicated
Message
data.
Authentication
C
Code(MAC) Double length Message
DEA key If issuer script Authentication Code
using secure (MAC) key, 16bytes. It
F: b 128
messaging is is used to calculate MAC
T: - supported when secure massaging
is required by issuer
L: 16
script.
Online
C UnionPay dedicated bit 1: 1 = Online
Authorization
data. authorization is required for
Indicator If the card
supports issuer It indicates if the card the current or previous
F: b 1 transaction, but online
authentication requested an ARQC and
T: – or issuer script the terminal was not authorization cannot be
processing completed. completed.
L: –
UnionPay dedicated
Online data.
Requested by
Indicator used during
card indicator
transaction processing to
F: b 1 R indicate that internal
card processes have
T: –
indicated that the
L: – transaction should be
processed online
Name (format;
Requirement Descriptions Value
tag; length)
UnionPay dedicated
PIN Try Limit
data.
C
F: b 8
It is the number of
If offline PIN is
T: – consecutive incorrect
supported.
PIN tries allowed by the
L: 1
issuer.
Proprietary
Application
Identifier It is part of AID which
Extension (PIX) identifies the Application
R Provider’s specific
F: b application according to
T: – ISO/IEC 7816-5.
L: 0–11
Registered
Application
Provider
It is part of AID which
Identifier (RID)
identifies the Application
R
F: b Provider according to
ISO/IEC 7816-5.
T: –
L: 5
Static Data
UnionPay dedicated
Authentication
data.
(SDA) Failure
C bit 1: 1 = Offline SDA for the
Indicator It indicates whether failed on last transaction
If SDA is offline SDA failed on the and the transaction was
F: b 1
supported. last transaction when the declined
T: – transaction was declined
offline
L: –
Name (format;
Requirement Descriptions Value
tag; length)
UnionPay dedicated
data.
Application
Cryptogram It is a double length
(AC) key application cryptogram
M key. It is 16 bits long. It
F: b 128
is used for online card
T: – authentication and online
issuer authentication,
L: 16
and Application
Cryptogram generation.
UnionPay
It is part of the issuer
Integrated
application data defined
Circuit Card
by UnionPay. It consists
Specifications -
of a length indicator,
Basic
derivation key index,
Specifications
cryptogram version
Discretionary R
number and Card
Data
Verification Results. It is
F: b 56 returned to the terminal
in GENERATE
T: – Application Cryptogram
response.
L: var 7 to 9
It indicates the
Application application in line with
Identifier (AID) ISO/IEC 7816-5. It
consists of Registered
F: b 40–128 R Application Provider
T: 4F Identifier (RID) and
Proprietary Application
L: 5–16 Identifier Extension
(PIX).
Mnemonic associated
Application tag R with AID. Used in
application selection.
F: ans 1–16 (According to
Application tag is
EMV, it will
T: 50 optional in the File
become
Control Information
L: 1–16 mandatory.)
(FCI) of an Application
Definition File (ADF)
Name (format;
Requirement Descriptions Value
tag; length)
and mandatory in an
ADF directory entry
Application
Primary
Account
Number(PAN)
Valid account No. of the
F: var. up to cn M
cardholder.
19
T: 5A
L: var. up to 10
Cardholder name,
Cardholder Notes: The value of this data
consistent with ISO/IEC
Name object can be Chinese
R 7813. If the cardholder
characters, and it may cause
F: ans 2–26 name is or shorter than
transaction rejections on a
26 bits, the tag 7FOB
T: 5F20 limited number of
shall not be used. The
international terminals
complete cardholder
Name (format;
Requirement Descriptions Value
tag; length)
Application
Expiration Date
L: 3
Application
Effective Date
L: 3
Issuer Country
Code
C
F: n 3 It indicates country of
If Application the issuer according to
T: 5F28 Usage Control ISO3166.
L: 2 is present.
Preferred
Language It stores 1 to 4 languages
by priority. Each
F: an 2 O represented by 2
T: 5F2D alphabetical characters
according to ISO639.
L: 2–8
Name (format;
Requirement Descriptions Value
tag; length)
L: 2
Application
primary account
number
sequence It is used to indicate
number different applications
O
with the same PAN in
F: n 2 the card.
T: 5F34
L: 1
Issuer URL
L: var.
Application
Template
According to
F: b C ISO7816-5, it includes 1
or more data objects
T: 61 If PSE present related to application
directory entry.
L: var. up to
252
File Control
Information
(FCI)
L: var. up to
252
Name (format;
Requirement Descriptions Value
tag; length)
T: 72
L: var.
Directory
Discretionary
Template
It is the issuer
F: var. discretionary part in the
O
directory according to
T: 73 ISO/IEC 7816-5.
L: var. up to
252
Response
Message
Template
C Contains the data objects
Format 2
(with tags and lengths)
If CDA is returned by the card in
F: var.
supported. response to a command.
T: 77
L: var.
Response
Message
Template Contains the data objects
Format 1 (without tags and
R lengths) returned by the
F: var. card in response to a
T: 80 command.
L: var.
Application Byte 1:
Interchange bit 8: 1 = RFU;
It is a list specifying
Profile (AIP)
capabilities of the card to
bit 7: 1 = SDA is supported;
F: b 16 M support the designated
functions in the bit 6: 1 = DDA is supported;
T: 82 application.
bit 5: 1 = Cardholder
L: 2 verification is supported;
Name (format;
Requirement Descriptions Value
tag; length)
bit 3: 1 = Issuer
Authentication is supported;
Dedicated File
(DF) Name
L: 5–16
It is delivered by the
issuer to the card
Issuer Script
through the terminal. It
Command
is included in issuer
F: b Script of the
O Please refer to Appendix B.
authorization response.
T: 86 Please refer to
descriptions on
L: var up to 261
command in Appendix
B.
bit 8:
Application C 1: Application shall not be
Priority
Indicates the priority of a selected without cardholder
Indicator
given application or confirmation;
F: b 8 If multiple
group of applications in 0: Application can be selected
payment
T: 87 a directory without cardholder
applications on
card confirmation;
L: 1
Bit 7-5: RFU (000)
Name (format;
Requirement Descriptions Value
tag; length)
Bit 4-1:
Card Risk
Management
Data Object List List of data objects (tags
1 (CDOL1) and lengths) to be passed
to the card application
F: b M
with the first
T: 8C GENERATE AC
command
L: var. up to
252
Name (format;
Requirement Descriptions Value
tag; length)
Card Risk
Management
Data Object List List of data objects (tags
2 (CDOL2) and lengths) to be passed
to the card application
F: b M
with the second
T: 8D GENERATE AC
command
L: var. up to
252
bit 7:
1 = Applying succeeding
It lists all cardholder
Cardholder CVM field if the CVM fails;
verification methods
Verification supported by the card 0 =Fail Cardholder
Method (CVM) application in the verification if the CVM fails;
List priority sequence.
bits 6–1 (CVM Type):
F: b R Note: An application can
have several CVM Lists, 000000 = Fail CVM
T: 8E processing;
such as one for domestic
L: var. up to transactions and one for
000001 = The card performs
252 international
plaintext PIN verification;
transactions.
000010 = Enciphered PIN
verified Online;
000100 = RFU;
000101 = RFU;
Name (format;
Requirement Descriptions Value
tag; length)
111111 = RFU.
UnionPay defines:
00 = Always;
04 = If there’s someone on
duty for the cash transaction;
06 = If the transaction
currency is same with the
application currency code and
the amount is less than X;
07 = If the transaction
currency is same with the
application currency code and
the amount is more than X;
08 = If the transaction
currency is same with the
application currency code and
the amount is less than Y;
Name (format;
Requirement Descriptions Value
tag; length)
09 = If the transaction
currency is same with the
application currency code and
the amount is more than Y;
0A–7F: RFU;
An additional 2 bytes is
added following byte 10 for
each additional CVM Code
and corresponding CVM
Condition
CA Public Key
Index (PKI)
C During offline SDA or
F: b 8 DDA process, it is used
If SDA or DDA together with RID to
T: 8F is supported. indicate CA public key.
L: 1
Issuer Public
Key Certificate C It is the issuer public key
certified by CA, which
F: b If SDA and can be used for offline
DDA are static and dynamic data
T: 90
supported. authentication.
L: NCA
Authorization Response
Name (format;
Requirement Descriptions Value
tag; length)
Code (2 bytes).
Issuer Public
Key Remainder It is portion of the issuer
C public key modulus that
F: b does not fit into the
If required. Issuer Public Key
T: 92
Certificate.
L: NI-NCA+36
Signed Static
It is the digit signature
application Data
signed by the issuer,
(SAD) C generated from critical
F: b If SDA is card data elements and
supported. personalized on the card.
T: 93 It is validated by the
terminal during SDA.
L: NI
Byte 1:
Name (format;
Requirement Descriptions Value
tag; length)
Transaction
Certificate Data
Transaction Certificate Data
Object List C
Object List (TDOL)
(TDOL) List of the data objects
If cryptogram (tag and length) used by F: b
F: b version the terminal to generate
requires TC Hash Value. T: 97
T: 97
pre-hashing
L: var. up to 252
L: var. up to
252
Application
Discretionary
Data
Data specified by the
F: b 8–256 O issuer as related to the
card application.
T: 9F05
L: 1–32
Byte 1:
bit 6: 1 = Domestic
commodity transaction is
Application It indicates restrictions valid;
Usage Control on card applications
bit 5: 1 = International
designated by the issuer,
F: b 16 commodity transaction is
O including regional
valid;
T: 9F07 application and service
type, etc. allowed for the bit 4: 1 = Domestic service
L: 2 card application transaction is valid;
bit 3: 1 = International
service transaction is valid;
bit 1: 1 = Terminal
transaction (excluding ATM)
is valid.
Name (format;
Requirement Descriptions Value
tag; length)
Byte 2:
Application
Version
Number. It is the version number
assigned by the payment
F: b 16 M
system for the
T: 9F08 application.
L: 2
Cardholder
If the cardholder name is Notes: Chinese characters
Name extended
more than 26 Bytes, the shall not be included in this
F: ans 27–45 complete part shall be tag; it may cause transaction
O
stored in this data rejections on small number of
T: 9F0B element. It is consistent terminals outside mainland
with ISO7813. China.
L: 27-45
Issuer Action R
It indicates the issuer’s Bit assignments are identical
Code
Will become conditions that cause the to those for Terminal
(IAC)-Denial
mandatory in transaction to be Verification Results (TVR).
F: b 40 future declined without
Name (format;
Requirement Descriptions Value
tag; length)
L: 5
Issuer Action
Code
R It indicates the issuer’s
(IAC)-online
Bit assignments are identical
Will become conditions that cause the
F: b 40 to those for Terminal
mandatory in transaction to be sent
Verification Results (TVR).
T: 9F0F future online.
L: 5
It is the proprietary
application data to be
sent to the issuer in an
online transaction.
If the issuer
discretionary data is
present, the discretionary
data is followed by one
byte indicating the
length of issuer
discretionary data. The
next1-15 bytes consists
of the concatenated
issuer discretionary data
Name (format;
Requirement Descriptions Value
tag; length)
Preferred mnemonic
associated with the AID.
Application
Displayed by the
Preferred name
terminal during
F: ans 1–16 application selection if
O
any of the character sets
T: 9F12 designated in the Issuer
Code Table Index are
L: 1–16
supported by the
terminal
Last Online
Application
Transaction C
Counter (ATC)
If the card or
Register It is the ATC value of the
the terminal
velocity check last transaction went The initial value is 0.
F: b 16
or new card online.
T: 9F13 check to be
L: 2 performed
Name (format;
Requirement Descriptions Value
tag; length)
Track 1
Discretionary
R
Data
It is the discretionary
Will be data in track i according
F: ans
changed to be to ISO/IEC 7813.
T: 9F1F optional.
L: var.
Upper limit of
Consecutive It is the maximum time
Offline C of consecutive offline
Transaction transactions allowed by
If the terminal the card before the card
F: b 8 velocity check requires online
is supported processing as specified
T: 9F23
by the issuer.
L: 1
Application
Cryptogram
(AC)
Generate the cryptogram
F: b 64 R for returning application
cryptogram.
T: 9F26
L:8
Name (format;
Requirement Descriptions Value
tag; length)
bits 8–7:
00 = AAC
01 = TC
10 = ARQC
Issuer Public
Issuer public key
Key Exponent C Exponent is used to
F: b If SDA and verify the Signed Static
DDA are Application Data and IC
T: 9F32 card public key
supported.
certificate.
L: 1 or 3
Application
Transaction
It records the times of
Counter
transaction processing
F: b 16 R after personalization. It
is maintained by the
T: 9F36 application in the card.
L: 2.
Name (format;
Requirement Descriptions Value
tag; length)
L: var.
Application C
currency code
If CVM
F: n3 requires Encoded in line with
amount check, ISO 4217.
T: 9F42
then this data is
L: 2 required.
Application
currency
exponent
It indicates the location
F: n 1 O of decimal from the right
side of amount data.
T: 9F44
L: 1
IC Card Public
Key Certificate
C It is the IC card public
F: b key certified by the
If DDA is
T: 9F46 supported. issuer.
L: NI
Name (format;
Requirement Descriptions Value
tag; length)
L: 1 or 3
IC Card Public
Key Remainder
It is the IC card public
C key Modulus which do
F: b
If required. not fit within the IC card
T: 9F48 public key certificate.
L: NIC - NI + 42
Dynamic Data
Authentication
It is the list of data
Data Object List
objects (tags and
(DDOL) C lengths) to be delivered
F: b If DDA is by the terminal to the
supported. card in INTERNAL
T: 9F49 AUTHENTICATE
Command,
L: var. up to
252
Static Data
Contains list of tags of
Authentication
primitive data objects
Tag List
C whose value fields are to The list can only include tags
F: – be include in the Signed of Application Interchange
Static Application Data Profile (AIP).
T: 9F4A or IC card public key
certificate.
L: var.
Signed
Dynamic
Signed Dynamic
application Data C application Data is
F: b If DDA is generated by card. It is
supported. validated by the terminal
T: 9F4B during DDA.
L: NIC
Name (format;
Requirement Descriptions Value
tag; length)
Log Entry
Byte 1:SFI of circulating
F: b 16 It provides number of transaction log files;
O SFI of log files and log
T: 9F4D file records. Byte 2: number of records in
transaction log files.
L: 2
Log Format
L : var
Application
currency code C
UnionPay dedicated
F: n 3 If card velocity data. Encoded in line
check is to be with ISO 4217:2001
T: 9F51
performed
L: 2
Name (format;
Requirement Descriptions Value
tag; length)
Byte 2:
Name (format;
Requirement Descriptions Value
tag; length)
Issuer
Authentication bit 8:
UnionPay dedicated
Indicator
C data. 1 = Issuer authentication is
F: b 8 mandatory;
If issuer It indicates when issuer
T: 9F56 authentication authentication is 0 = Issuer authentication is
is supported. supported, whether it is optional;
L: 1 mandatory or optional.
bits 7–1: RFU (0000000).
Name (format;
Requirement Descriptions Value
tag; length)
L: 2 check is
supported.
UnionPay dedicated
Lower limit of
data.
consecutive
C
offline It is the maximum times
transaction If the terminal of consecutive offline
velocity check transactions allowed for
F: b 8
to be the application in the
T: 9F58 performed terminal with online
processing capability as
L: 1
specified by the issuer.
UnionPay dedicated
Upper limit of
C data.
Consecutive
Offline If card velocity It is the maximum time
Transaction checking of consecutive offline
requires a transaction allowed for
F: b 8
decline if the card application
T: 9F59 online not before requiring online
available processing as specified
L: 1
by the issuer.
UnionPay dedicated
Upper limit for data.
accumulated
C It is the maximum limit
offline
on offline transactions in
transaction If velocity the designated currency
amount check on or designated and
accumulated secondary currency
F: n 12
amount is to be allowed for the card
T: 9F5C performed. application before a
L: 6 transaction is declined
after an online
transaction is unable to
Name (format;
Requirement Descriptions Value
tag; length)
be performed
Cardholder ID
Number
O
F: an 40 Cardholder ID number.
T: 9F61
L: 1-40
00: ID card;
05: Others.
Bit 9:
Name (format;
Requirement Descriptions Value
tag; length)
0001=NFC-SD Mode
0010=NFC-SIM Mode
1010-1111 Reserved
Name (format;
Requirement Descriptions Value
tag; length)
L: 1 processing.
Byte 1:
Accumulated
UnionPay dedicated
offline C
data.
transaction
If velocity
amount limit It is the maximum limit
check on
(dual on accumulated offline
accumulated
currencies) transaction amount (dual
amount (double
currencies). If it is
F: n 12 currencies) is
exceeded, the transaction
to be
T: 9F75 shall request for online
performed.
processing.
L: 6
Secondary
It is the secondary
Application C currency to be converted
Currency Code
If dual to the application
F: n 3 currency designated currency in
velocity check which the account is
T: 9F76 managed. It is encoded
is supported.
according to ISO 4217.
L: 2
File Control
Information
(FCI) . UnionPay Integrated
Circuit Card
template R Specifications - Basic
F: var. Specifications
proprietary data.
T: A5
L: var. up to
Name (format;
Requirement Descriptions Value
tag; length)
252
File Control
Information
(FCI) issuer
Discretionary
data
It is the issuer
O
F: var. discretionary part in FCI.
T: BF0C
L: var. up to
222
Table A.2 specifies the requirements on the card and issuer data elements.
A.2.1 Tag
Column “Backup Required” specifies whether the data needs backup or not.
Under some special circumstances, such as sudden withdrawal of card and sudden
power down during transaction, the card shall be able to protect the application data
from damage.
Column “Update” specifies whether the data can be updated or not. If allowed, the
Update Commands are listed in Column “Command”.
Column “Retrieval” specifies whether the data can be retrieved by the terminal or
returned to the terminal through commands. Data marked with “SD” can only be
retrieved from special devices. It cannot be retrieved by the terminal during
financial transaction.
In card risk management data, “static” indicates that the data cannot be changed but
can be returned to the terminal through GET DATA command; “dynamic”
indicates that the data cannot be updated by the terminal through commands or
shall not be retrieved by the terminal.
Data marked as “Secret” shall be securely stored in the card. The data cannot be
retrieved by the terminal or other devices, nor updated for certain special
circumstances. PIN can be changed through Command PIN CHANGE /
UNBLOCK with secure messaging.
Column “ADF” specifies the data is stored under payment system ADF Directory.
The terminal reads the data during Application Selection through READ RECORD
Command.
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
GENERATE
Application
9F26 R Application
Cryptogram (AC)
Cryptogram
Application Currency
9F42 C 29 N READ RECORD Match 9F51
Code
Application Currency
9F44 C 1, 2, 3 or 29 N READ RECORD
Exponent
Application Default
9F52 C 19 Static
Action (ADA)
Application
9F05 O N READ RECORD
Discretionary Data
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
Application Effective
5F25 O N READ RECORD
Date
Application Expiration
5F24 M N READ RECORD
Date
GET
Application File
94 R N PROCESSING
Locator (AFL)
OPTIONS
Application Identifier
4F R N READ RECORD ADF
(AID)
Application GET
Interchange Profile 82 M N PROCESSING
(AIP) OPTIONS
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
Application PAN
5F34 O N READ RECORD
Sequence Number
Application Transaction
9F36 R Backup N GET DATA 5, 6
Counter (ATC)
Application Usage
9F07 O N READ RECORD
Control (AUC)
Application Version
9F08 M N READ RECORD
Number
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
Card Risk
Management Data 8C M N READ RECORD
Object List 1 (CDOL1)
GENERATE
Card Verification Part of
N Application
Results (CVR) 9F10.
Cryptogram
Will be C
Cardholder Name 5F20 R N READ RECORD
(9).
Cardholder Name
9F0B O N READ RECORD
Extension
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
cardholder Verification
8E R N READ RECORD
Method (CVM) List
Consecutive Offline
GET DATA
Transaction Limit 9F53 C 1 PUT DATA
(special device)
(international-currency)
Consecutive Offline
GET DATA
Transaction Limit 9F72 C 7 PUT DATA
(special device)
(international-country)
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
Cryptogram GENERATE
Information Data 9F27 R Application
(CID) Cryptogram
GENERATE
Cryptogram Version Part of
R N Application
Number 9F10.
Cryptogram
Backup
Accumulated Offline
C 2 or default N
Transaction Amount
as 9F54
Accumulated Offline
GET DATA
Transaction Amount 9F54 C 2 PUT DATA
(special device)
Limit
Upper Limit of
GET DATA
Accumulated Offline 9F5C O 2 or 3 PUT DATA
(special device)
Transaction Amount
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
Accumulated Offline
GET DATA
Transaction Amount 9F75 C 3 PUT DATA
(special device)
Limit (dual currencies)
Data Authentication
9F45 O READ RECORD Part of 93.
Code
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
Part of
Derivation Key Index O N N
9F10.
Directory Discretionary
73 O N READ RECORD
Template
Dynamic Data
Authentication Data 9F49 C 31 N READ RECORD ADF
Object List (DDOL)
Backup
DDA Failure Indicator C 31 or default N N dynamic
as 0
File Control
Information (FCI)
BF0C O N SELECT
Issuer Discretionary
Data
FCI Proprietary
A5 R N SELECT
Template
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
INTERNAL
ICC Dynamic Data C 31
AUTHENTICATE
INTERNAL Part of
ICC Dynamic Number 9F4C C 31
AUTHENTICATE 9F4B.
Public key
Exponent 9F47 C 31 N READ RECORD
Public key
certificate 9F46 C 31 N READ RECORD
Public key
remainder 9F48 C 15 N READ RECORD
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
GENERATE
Issuer Application Data 9F10 R N Application
Cryptogram
Issuer Authentication
91 O 19
Data
Backup
Issuer Authentication
C 19 or default N N dynamic
Failure Indicator
as 0 or 1
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
must match
Issuer Country Code 5F28 C 17 N READ RECORD
9F57.
Issuer public
key Exponent 9F32
C 30 or 31 N READ RECORD
Issuer public key
remainder
92 C 15 N READ RECORD
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
Backup
Issuer Script Command
C 18 or default N N dynamic
Counter
as 0
Backup
Issuer Script Failure
C 18 or default N N dynamic
Indicator
as 0 or 1
Backup
ATC register for the GET DATA 5, 6 or
9F13 C 4,5,6,8 or 24 or default N
last online transaction 24
is 1
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
SELECT
Log Entry 9F4D O ADF
Application
Lower limit of
UPDATE
consecutive offline 9F14 C 5,6,24 Backup READ RECORD
RECORD
transaction
Lower limit of
GET DATA
consecutive offline 9F58 C 4 Backup PUT DATA
(special device)
transaction
Message Authentication
C 18 and 28 N N Secret
Code (MAC) DEA key
Default
Online Authorization
R as 1 or N N dynamic
Indicator
Backup
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
Backup PIN
PIN Try Counter 9F17 C 21 or default CHANGE / GET DATA 27
as limit UNBLOCK
PIN
Offline PIN C 21 Backup CHANGE / N Secret
UNBLOCK
Response Message
80 R N N
Template Format 1
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
SELECT
Short File Identifier GET
88 N
(SFI) PROCESSING
OPTIONS
Signed Static
93 C 30 N READ RECORD
Application Data
Backup
SDA Failure Indicator C 30 or default N N dynamic
as 0
Mand/
Backup Static /
Name Tag Cond/ Conditions Update Retrieve Secret data In ADF Others
required Dynamic
Opt
Must be
Track 2 Equivalent UPDATE
57 M READ RECORD Record 1
Data RECORD25
that SFI=1.
Transaction Certificate
Data Object List 97 C 23 N READ RECORD
(TDOL)
Upper Limit of
UPDATE
Consecutive Offline 9F23 C 5,6,24 Backup READ RECORD
RECORD
Transaction
Upper Limit of
GET DATA
Consecutive Offline 9F59 C 8 Backup PUT DATA
(special device)
Transaction
Product Label
9F63 O N READ RECORD
Information
For the detailed conditions corresponding to the condition No. in the Data
requirement list, please refer to the table below.
Condition
Descriptions
No./Code
Data can only be retrieved from the designated device. This procedure is not
Special device
performed for financial transaction.
Condition
Descriptions
No./Code
If corresponding public key certificate is present and entire public key does
15
not fit into certificate
30 If SDA is supported.
Condition
Descriptions
No./Code
31 If DDA is supported.
Tag (T): Define the type of Data Object, its length can be 1 or 2 byte
Length (L): Define the length of subsequent field, the data object length used in
the interaction between card and terminal can be 1 or 2 byte.
Remarks: In the Issuer script, the length may be 3 bytes, but in this specification we
will only discuss the data object in card-terminal interaction.
Value (V): Define the value of the data object. If Length (L) = "00", V does not
exist.
The structure data object: Value includes one or many basic data objects or
constructed data object, and the value of the latter is called template.
B8 B7 B6 B5 B4 B3 B2 B1 Definition
0 0 Universal class
0 1 Application class
1 0 Context-specific class
1 1 Private class
1 1 1 1 1 subsequent byte
B8 B7 B6 B5 B4 B3 B2 B1 Definition
Padding byte "00" can appear in the template. The padding byte must appear before,
after or in-between the basic data objects, and cannot appear in the basic data
objects, and the length (L) of the Constructed data object must include the length of
the padding byte. (For example, length variation due to the deletion or amendment
of basic data object. In such circumstances, the padding byte "00" may appear in the
value of Constructed data object which include that basic data.)
If the application class data object is defined in ISO/IEC 7816, and then we should
follow the definition and application method in ISO/IEC 7816.
'61 to 6F' , as "application class templates”, are defined as '61 to 6F' in ISO/IEC
7816.
'70 to 7F', as application class template, are defined in various parts in this
specification. '78', '79', '7D' and '7E' are defined in ISO/IEC 7816-6, but are not
adopted in the specification.
Context-specific class data object should follow the definitions in this specification.
This Appendix describes the commands applied in different chapters and supported
by the card.
EXTERNAL AUTHENTICATE
GET DATA
INTERNAL AUTHENTICATE
READ RECORD
SELECT
VERIFY
The commands above can be used for other purpose, such as card personalization.
The terminal sends commands to the card, and the card returns command responses
to the terminal after processing is completed. For each command, CLA and INS
bytes indicate the command type; parameter byte P1 and P2 provides additional
processing information. A command can also include a data field.
Command Response includes two status bytes (SW1 and SW2) that describes
command results. When a command is complete successfully, SW1 and SW2 equal
to “9000”. Other values indicate that the command is not complete correctly.
Response to a command may also include response data.
Issuer Script Command of some special functions shall be sent to the card from the
device under the issuer’s control during non-financial transactions, such as
APPLICATION UNBLOCK AND PIN CHANGE/UNBLOCK.
includes confidential data such as cardholder PIN, the data shall be encrypted for
protection.
For SELECT command, invalid application shall returned FCI and status byte
“The file selected is invalid” (SW1 SW2='6283').
Code Value
CLA ‘84’
INS ‘1E’
Le Not present
Data field of command message includes MAC data encoded in accordance with
the Secure Messaging format specified in the Security Specification.
No matter whether the application is valid or not, '9000' code always indicates that
the command is successfully performed.
Code Value
CLA ‘84’
INS ‘18’
Le Not present
Data field of command message includes MAC data encoded in accordance with
the Secure Messaging format specified in the Security Specification.
No matter whether the application is valid or not, '9000' code indicates that the
command is performed successfully.
CARD BLOCK command stops all applications in the IC card, including those
hidden applications.
Code Value
CLA ‘84’
INS ‘16’
Le Not present
Data field of command message includes MAC data encoded in accordance with
the Secure Messaging format described in the Security Specification.
No matter whether the card has been blocked or not, '9000' code indicates that the
command is performed successfully.
Code Value
CLA ‘00’
INS ‘82’
P1 ‘00’
P2 ‘00’
Lc 8-16
Code Value
Le Not present.
According to the UnionPay rules, the data field of this command message includes
the range whose tag is '91'. It is encoded as follows:
In this version, issuer authentication data consists of the following two data
elements:
ARPC (8 bytes);
If verification fails, “6300” is returned. If during the transaction, the card has
received the EXTERNAL AUTHENTICATE command, the card will return
“6985”.
Type Meaning
Code Value
CLA ‘80’
INS ‘AE’
P2 ‘00’
Lc Var.
Le ‘00’
b8 b7 B6 b5 b4 b3 b2 b1 Meaning
0 0 AAC
0 1 TC
1 0 ARQC
1 1 RFU.
x x x x x RFU.
Data field of command message is the terminal data used to generate Application
Cryptogram. The detailed data contents are specified in Appendix D.
Data field of the response message includes a data object encoded in BER-TLV.
The data object needs to be encoded in either of the following two formats.
Format 1:
The data object in the response message is an elementary data object whose tag is
'80'. Data field in connected by the data objects specified in the table below. There
is no separator (tag and length) between data objects.
Value Requirement
Format 2:
The data object of response message is a structure data object whose tag is '77'.
Data field can include several BER-TLV encoding objects, but it must include
Cryptogram Information Data, Application Transaction Counter and the
cryptogram calculated by the IC card (an application cryptogram or dedicated
cryptogram). Response messages that may include application and interpretation to
dedicated data objects are not within the scope of This Specification.
If the response message is the signature data defined in Chapter 9, 14 and 16 under
Part VII of This Specification, Format 2 shall be adopted to answer CDA. For
format of the response data unit, please refer to 5.3.6 of the Security Specification.
If the card does not execute CDA, data objects in data field of the Command
Response message shall be encoded according to Format 1. If the card executes
CDA, data objects in data field of the Command Response message shall be
encoded according to Format 2.
For the two formats above, cryptogram data included in Response message of
GENERATE application cryptograms command is encoded according to the
methods specified in the table below:
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
0 0 AAC
0 1 TC
1 0 ARQC
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
1 1 AAR
0 Advice is requested.
1 Advice is requested.
Reason/Advice/authorization reference
x x x
code
0 0 0 No information.
For one transaction, the card can process at most two GENERATE Application
Cryptogram Command. If three or more such commands are received, the card will
return “6985”.
The part below describes the data accessed on a special device through GET DATA
Command during non-financial transaction, and the access of data with GET
DATA command during the financial transaction.
Special device
The table below specifies the static data which can be accessed by special
devices under the issuer’s control through GET DATA Command and
cannot be obtained by ordinary terminals through GET DATA Command.
Data Element
Financial Transaction
GET DATA Command is used to obtain an elementary data object that is not
packaged in the records from the current application. GET DATA Command can
be used to basic data objects ATC (tag '9F36'), ATC register for the last online
transaction (tag '9F13') or cryptogram try counter (tag '9F17') and log format (tag
'9F4F').
Code Value
CLA ‘80’
INS ‘CA’
Lc Not present
Le ‘00’
Data field of the response message includes elementary data objects (including tag
and length) described in P1 P2 of command message.
If the data requested in the command cannot be returned as it is dedicated data, the
card returns “6A88”.
Code Value
CLA ‘80’
INS ‘A8’
P1 P2 ‘00’
Lc ‘00’
Le ‘00’
Data field of command message shall be encoded in line with the Processing Data
Object List (PDOL) provided by the IC card. PDOL is marked with tag “83”. When
IC Card does not provide the Data Object List, data length field of the template will
be set as 0. Otherwise, data length field of the template will be equal to the total
length of the data object range transmitted to the IC card.
Data field of the response message includes a data object encoded according to
BER-TLV.
This data object needs to be encoded in line with one of the following two formats:
Format 1:
Data object of the response message is an elementary data object whose Tag is '80'.
The data field consists of the connected ranges of Application Interchange Profile
(AIP) and Application File Locator (AFL) specified in the table below. There is no
separator between data objects (tag and length).
Table B.13: Format for Data Field of GET PROCESSING OPTIONS Response
Message
Format 2:
Data object of the response message is an elementary data object whose Tag is '77'.
The data field may consists of multiple objects encoded by BER-TLV but shall
contains Application Interchange Profile (AIP) and Application File Locator
(AFL).
Code Value
CLA ‘00’
INS ‘88
P1 ‘00’
P2 ‘00’
Code Value
Le ‘00’
Data field of the response message includes a data object encoded according to
BER-TLV. The data object shall be encoded in the following format:
Data object of the response message is an elementary data object whose Tag is ‘80’.
The data field includes signed dynamic application data, which shall be defined in
line with rules specified in the UnionPay Integrated Circuit Card Specifications -
Basic Specifications Part4:Debit/Credit Application Security Specification n.
To reset the value of PIN try counter to the PIN try limit (maximum value);
For confidentiality, if the command includes any PIN data, the data shall be
encrypted.
Note: Offline PIN refers to the PIN related to the application and stored in the card.
It is used to verify PIN data transmitted from the command.
Code Value
CLA ‘84’
INS ‘24’
P1 ‘00’
P2 ‘00’、‘01’ or ‘02’
Lc Bytes of data
Data Data elements of encrypted PIN (if any) and MAC data
Le Not existing.
When P2 is “01”, PIN try counter shall be reset and PIN shall be changed. Current
PIN shall be used during PIN change.
When P2 is “02”, PIN try counter shall be reset and PIN shall be changed. Current
PIN shall not be used during PIN change.
Data field of command message includes PIN encrypted data which can be
followed by 4 to 8 bytes of Secure Messaging MAC data.
If P2 is ‘00’, refer to PIN UNBLOCK and PIN try counter is reset to PIN try limit.
Command Data field only includes MAC. As PIN CHANGE / UNBLOCK
Command does not include new PIN value, PIN will not be updated.
When P2 equals to ‘01’ or ‘02’, the processing procedures are specified in B.10.1
and B.10.2.
If parameter P2 in the command equals to “01”, Command Data field includes PIN
encrypted data and MAC. PIN encrypted data shall be generated through the
following steps:
1. The issuer uses the Secure Messaging for data encryption to encrypt Master
Key and separately generate the card Secure Messaging Encrypted Unique
DEA Keys: ENC UDK-A and ENC UDK-B.
6. To encrypt 8 byte data block D with Ks and obtain PIN encrypted data.
If parameter P2 of the command equals to “02”, the command Data field includes
PIN encrypted data and MAC. PIN encrypted data is generated through the
following procedures:
1. The issuer determines the Secure Messaging encryption Master Key for data
encryption, and scattered generates the card Secure Messaging Encryption
Unique DEA Keys: ENC UDK-A and ENC UDK-B.
PUT DATA Command is used to change the value of some elementary data objects
in the card. Only the data with tags can be changed with this Command. This
command cannot be used to change structural data object.
The table below specifies the data that can be changed with this Command.
Data Element
Code Value
CLA ‘04’
Code Value
INS ‘DA’
Data field New value of data objects (excluding tag and length) and MAC data
Le Not existing.
Command Data field includes data objects to be changed. The MAC with 4 to 8
bytes is added. For calculation of MAC, please refer to Appendix C.
The table below describes the possible warning information returned by this
command:
62 00 No response information.
The table below specifies possible error information returned by this Command.
64 00 No exact diagnosis.
65 81 Memory failure.
67 00 Mistaken length.
6A 80 Wrong parameter.
Response from the IC card will include the record read out.
Code Value
CLA ‘00’
Code Value
INS ‘B2’
P1 record number
Lc Not existing.
Le ‘00’
The table below defines the cited control parameters of the command message.
b8 B7 b6 b5 b4 b3 b2 b1 Meaning
x x x x x SFI
For any successful READ RECORD command, data field of the response message
shall include the records read out. For SFI ranging from 1 to 10, the record is a
structural data object encoded with BER-TLV. Encoding shall be carried out in line
with the table below.
For SFI ranging beyond 1-10, This Specification is not applicable for response
message of READ RECORD Command.
SELECT command selects PSE, DDF or ADF in IC card through file name or AID.
Application selection is specified in Chapter 4 of this book.
For the codes of SELECT command message, please refer to the table below:
Code Value
CLA ‘00’
INS ‘A4’
Lc ‘05’ - ‘10’
Le ‘00’
The table below defines the cited control parameters of SELECT command
message:
B8 b7 b6 b5 b4 b3 b2 b1 Meaning
0 0 0 0 0
1 Selected by name.
0 0
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
1 0 Next one.
Data field of the command message shall include the name of PSE and DF selected
or AID.
Data field of the response message shall include FCI of PSE, or ADF selected.
Table B.26, Table B.27 and Table B.28 define the tags of applications specified in
This Specification. Additional tags responded in FCIs that are beyond scope of This
Specification shall be omitted. Card cannot use any padding byte in FCI, however,
it should be successfully received and correctly transmitted instead of rejection
when the terminal receives FCI with padding bytes.
The table below defines FCI responded after PSE is successfully selected:
The table below defines FCI responded after ADF is successfully selected:
‘84’ Name of DF M
‘9F38’ PDOL O
One or more
‘XXXX’ additional (dedicated)
data elements coming
(Identifier specified in O
from application
Volume 3) provider, the issuer or
the IC card supplier.
Note: for the card with several applications, it is strongly recommended that
“Application tag” data element shall be included in the response message so that
when the terminal uses “AID list” method to select application, the cardholder can
easily select/confirm the application.
For the code of UPDATE RECORD Command message, please refer to the table
below:
Code Value
CLA ‘04’
INS ‘DC’
P1 record number
Code Value
Le Not existing.
The table below defines the cited control parameters of the command message.
b8 B7 b6 b5 b4 b3 b2 b1 Meaning
x x x x x SFI
1 0 0 P1 is record number
Data field specifies the new record contents to be changed. MAC length is 4 to 8
bytes. For algorithm, please refer to Appendix C.
The table below specifies possible warning information that may be returned by the
Command:
62 00 No information returned.
The table below specifies possible error information that may be returned by the
Command.
64 00 No exact diagnosis.
65 81 Memory failure.
67 00 Mistaken length.
VERIFY Command makes IC card to compare Transaction PIN data in data field
of the Command message with relevant reference PIN data of the application for
verification. Verification mode is decided by the application in IC card. As it is
Code Value
CLA ‘00’
INS ‘20
P1 ‘00’
Lc var.
Le Not existing.
b8 b7 B6 b5 b4 b3 b2 b1 Meaning
2
P2=’00’ is not adopted in this specification.
b8 b7 B6 b5 b4 b3 b2 b1 Meaning
For VERIFY command processing procedures and CVM rules, please refer to
Chapter 11 of this book.
Data blocks of plaintext offline PIN, please refer to the following format
organization.
In which:
Name Value
PIN/supplementar
P/F Depend on PIN length.
y bit
This Appendix describes how secure messaging is used in Issuer Script Command.
The basic purpose of secure messaging is to ensure the confidentiality of data and
message integrity and to perform issuer authentication. Message integrity and
issuer authentication are realized through MAC, while data confidentiality is
realized through encipherment of plaintext Command data.
Message authentication code (MAC) is generated based on all data elements in the
Command including Command head. Command Integrity including data field part
(if any) shall be guaranteed through Secure Messaging.
During Secure Messaging processing, session keys of MAC key are used. For
generation of session key, please refer to C.4. MAC session keys are generated by
the Secure Messaging authentication (MAC) key (MAC UDK) in the card.
1. An initial vector is set equal to 8 bytes of hexadecimal zeros (this step can be
ignored);
CLA, INS, P1, P2, Lc (Lc indicated the length of the data included in the
command);
Last ATC (for issuer script processing, this is the ATC transmitted in the
request message);
3. This block of data is formatted into 8-byte data blocks, labeled D1, D2, D3,D4,
and so forth. The last data block may be 1 to 8 bytes in length;
4. If the last data block is 8 bytes, an additional 8 bytes data block is concatenated
to the right of the last data block as follows: Hexadecimal 80 00 00 00 00 00
00 00. Proceed to step 5.
If the last data block is less than 8 bytes, it is padded to the right with a-byte
hexadecimal 80. If the length reaches 8 bytes, step 5 shall be performed. If the
length is still less than 8 bytes, it is right filled with 1 byte hexadecimal until the
length is 8 bytes.
5. Use MAC session keys to encipher the data blocks. For generation of MAC
session keys, please refer to C.4 Session Key Generation.
Figure below is the flow chart illustrating how MAC is generated from MAC
session key A and B.
Initial
初始值 value I2 I3 I4 I5
KM
DEA(d)
B
+ KMA DEA(e) KMA DEA(e) KMA DEA(e) KMA DEA(e)
O5
I1=D1 O1 O2 O3 O4
KM
DEA(e)
A
+ + +
O6
D2 D3 D4
MAC
Note:
说明:
I = 输入 D = 数据块
UPI Confidential
DEA(e)= 数据加密算法(加密模式) KMA = MAC过程密钥A 232
DEA(d)= 数据加密算法(解密模式) KMB = MAC过程密钥B
O = 输出 + = 异或
Part II Debit/Credit Application Card Specification
0 = Output + = x or
Figure C.1: Algorithm for MAC Calculation with Double Length DEA Key
During Secure Messaging processing, Data Encipherment session key is used for
generation of session key, please refer to C.4 GENERATE Session Key. Data
Encipherment session key generation process is seeded with the card’s Data
Encipherment DEA Key (ENC UDK).
Data plaintext;
And then the entire block of data is enciphered using the data encipherment
technique..
2. The block of data created in step 1 is divided into 8 bytes data blocks, labeled
D1, D2, D3, D4. and so forth. The last data block shall be 1 to 8 bytes in
length;
3. If the last (or only) data block is equal to 8 bytes, proceed to step 4. if the last
data block is less than 8 bytes, it is padded to the right with a-byte hexadecimal
80. If the length reaches 8 bytes, step 4 shall be performed. If the length is still
less than 8 bytes, it is right filled with 1 byte hexadecimal until the length is 8
bytes
4. Each data block is enciphered with data encipherment session keys. For
generation of session keys, please refer to C.4 GENERATE Session Key.
The table below illustrates the encipherment process on data blocks with data
encipherment session key A and B.
DN
KDA KDB
DEA(e) DEA(d)
O1 O2
KDA
DEA(e)
加密的DN
说明: Enciphered Dn
5. After the previous steps are completed, all enciphered data blocks are
concatenated together in order (enciphered D1, D2, D3. and so forth…). The
resulting block of data is inserted in the command data field
After receiving the Command, the card will decipher the enciphered data in the
Command Data field through the following procedures:
1. Divide the block of data in the Command data field into 8 bytes blocks, labeled:
D1, D2, D3, D4, and so forth. Each data block is deciphered using the data
encipherment session key.
The figure below illustrates how the data encipherment session key A and B
decipher the data blocks.
DN
KDA KDB
DEA(d) DEA(e)
O1 O2
KDA
DEA(d)
解密的DN
说明: Deciphered Dn
1. Card keys used to generate session keys are MAC DEA Key A and B (MAC
UDK), data encipherment DEA Key A and B (ENC UDK) for the selected
cryptographic process
2. Make 2-byte ATC right aligned and padded with 6 bytes of 00 on the left (refer
to Invert 2-byte ATC and make it right aligned and padded 6 bytes of 00 on the
left(refer to the UnionPay Integrated Circuit Card Specifications - Basic
Specifications Part4:Debit/Credit Application Security Specification for
details).
This Appendix describes keys and algorithms related to the generation of the online
authentication cryptogram ( AAC, TC and ARQC).
The issuer shall decide the data source that generates application key.
The table below specifies the data order of GENERATE application cryptogram.
Authorized amount √ √
Other amounts √ √
Terminal Verification √ √
Results
Transaction currency √ √
code
Transaction date √ √
Transaction type √ √
Unpredictable Number √ √
Application Interchange √
Profile (AIP)
Application transaction √
counter (ATC)
The TC, AAC and ARQC are generated by putting selected data into the algorithm.
This process includes following steps:
1. The first GENERATE AC command, the terminal shall transmit to the card the
data specified in CDOL1. In the second GENERATE AC command, the
terminal shall transmit to the card the data specified in CDOL2.
2. Based on internal card risk management results, the card determines whether to
return a TC/AAC or an ARQC in the response message.
The card shall concatenate the following data in the order specified to create a
block of data:
Data elements input directly by the card into the cryptogram in the order
specified by the cryptogram version selected.
3. The card shall format this block of data into 8 bytes data block, labeled each:
D1, D2, D3, D4. and so forth
5. Use the session key to generate application cryptogram through DEA key
algorithm;
6. Session key is generated with the unique DEA key (UDK) in the card. For the
detailed generation procedures, please refer to C.4. The figure below illustrates
how session Keys A and B are used to generate application cryptogram.
I1=D1 I2 I3 I4 I5
KB DEA(d)
KA DEA(e) KA DEA(e) KA DEA(e) KA DEA(e) KA DEA(e)
06
O1 O2 O3 O4 O5
KA DEA(e)
+ + + +
O7
D2 D3 D4 D5
TC/AAC/ARQC
说明:
I = 输入
Note: D = 数据块
DEA(e)= 数据加密算法(加密模式) KA = 密钥A
DEA(d)= 数据加密算法(解密模式) KB = 密钥B
O = 输出
I = Input+ = 异或
D = Data block
0 = Output + = x or
The ARQC transmitted in the request message is used as input to the exclusive-OR
algorithm. There is no need for the card to recalculate the ARQC.
The Authorization response code used in the exclusive-OR processing shall be the
one transmitted to the card in the Issuer Authentication data in the EXTERNAL
Authenticate command. Prior to Exclusive-OR processing, the code left justifies
the Authorization Response Code in an 8-byte field and zero fills (hexadecimal 0)
the remaining 6 bytes.
3. Session keys shall be used to generate ARPC with DEA key algorithm. The
figure below illustrates the ARPC generation method.
I1=D1
KA DEA(e)
O1
KB DEA(d)
O2
KB DEA(e)
O3
Note:
说明:
0 = Output
This part describes the methodology of key derivation. The unique DEA key in the
card is generated through Master DEA Key (MDK) derivation during card
personalization.
The figure below illustrates the generation process of unique DEA Keys A and B.
Issuer host
security module
The issuer generates the
double length Master DEA
key (MDK). MDK
UDKB
To derive the Unique DEA Key A, the Application PAN and Application PAN
sequence number shall be concatenated together in a 16-hexadecimal field. (If the
Application PAN Sequence Number is not present, it shall be zero filled). If the
length of the application PAN followed by the Application PAN sequence number
is less than 16 numbers, the following formatting rules shall be applied:
If the length is more than 16 numbers, use only the right-most 16 digits
To derive the Unique DEA Key B, the Application PAN and Application PAN
Sequence Number shall first be concatenated together in a 16-hexadecimal field
using the formatting rules as above, and then inverted. Inversion shall be performed
at the bit level, where each bit with value ‘1” is set to “0” and each bit with value
“0” is set to “1”.
The figure below illustrates the card authentication process with unique DEA Key
A and B (UDKA and UDKB).
As indicated in the figure, the derivation of the Unique DEA Keys shall be
performed in a host security module and the verification of the ARQC shall also be
performed in a host security module.
The table below specifies the data elements of GENERATE TC/AAC and ARQC
and the order.
Authorized amount
Other amounts
Transaction date
Transaction type
Unpredictable number
Cryptogram Version 01 uses the symmetric key algorithm specified in the Security
Specification to generate Application Cryptogram.
3DES 01
SSF33 02
The issuer can set an upper limit of authorized transactions for each card while issuing an
electronic cash application. That limit is depended on each card and managed internally by the
Issuer. That account is called “electronic cash account”.
In the issuer host system of the Issuer, the Electronic Cash Account can be managed as an
independent account. The cardholder can transfer the amount to the electronic cash account in
the following ways1):
——Cash Loading;
The following conditions may affect the differences between the electronic cash account
amount and Electronic Cash Balance:
——Delay between the time of transaction execution, the time of Issuer’s acceptance and
transaction record clearing;
——Delay between the time of Issuer’s loading of electronic cash account and the time of
updating of Electronic Cash Balance of the financial IC card (through the Issuer script
command, requiring that the card and the Issuer should be connected online);;
——Exception Processing.
1)
What the Issuer needs to know is that, the Electronic Cash Account Balance is a provision for offline
transaction which has not been submitted for clearing. Any offline-authorized transaction should be cleared
against the Electronic Cash Account Balance. Therefore, the Electronic Cash Account Balance does not
always reflect the Electronic Cash Balance of the card.
Graph 1 shows the different constituent parts of the function patterns for Low-value
Payment.
Card loading
Transfer of amount
Cardholder primary
Card2 EC Account4
Unload account3
n
tio
sac
ran
in et
Purchase ffl
o
ear
Cl Authorize and
Clear Online
Transaction
Terminal1
Note 1: “Terminal” refers to any financial chip terminal which is compatible with
debit/credit application of This Specifications may have an online capability or not.
Note 2: “Card” refers to the financial IC cards which conform to the debit/credit
application program of This Specifications are personalized and capable of executing
Low-value Payment Transaction.
Note 3: “Cardholder primary account” is supposed to be the current account used in the
online authorization.
Note 4: "Electronic Cash Account" has reserved to the electronic cash amount in advance,
for:
——Preventing the electronic cash amount from being used for non-Low-value payment;
In the offline transaction, the card uses the risk management internally to determine
whether the transaction may be authorized offline. The card will compare the current authorized
amount with Electronic Cash Balance. If the current authorized amount exceeds the Electronic
Cash Balance of the card, it must request the online authorization.
If the transaction is approved offline, the card will deduct the authorized amount of this
transaction from the Electronic Cash Balance. If the card requests the online authorization but
the terminal does not support online function, it will perform the standard debit/credit
transaction processing.
The offline transaction does not have any impact on the Issuer system. For the offline
transaction, the Issuer may modify its host system so that more checks can be executed in the
clearing processing. For instance, the system shall check the Application Transaction Counter
(ATC) received to determine whether there are any outstanding transactions to be submitted for
clearing.
——The difference between Electronic Cash Balance and the authorized amount is lower than
the Electronic Cash Reset Threshold;
——Exceptions occur during the transaction which forces the transaction to be conducted
online (e.g. The cardholder is unable to enter the correct offline PIN).
In general, the host system will execute the same processing as other financial IC card
authorizations on the electronic cash account during online processing, includes:
——perform online CAM by verifying the ARQC which is sent in field 55;
——check the data content on the chip to find out the causes why the transaction is sent to
online.
If an additional processing is required depends on the reasons that the transaction is sent for
online processing, such as insufficient Electronic Cash Balance or enter incorrect PIN. The
issuer host system will execute different authorization processing according to those reasons.
If the authorized amount is higher than the card’s Electronic Cash Balance, the transaction will
be sent for online processing. This is the most common condition that a transaction is sent for
online processing. The corresponding authorization processing mode will be determined by the
Issuer itself, host system will execute any additional test and check defined by the Issuer in its
authorization processing.
——The transaction is only authorized to the cardholder’s primary account. The balance of
primary account should be checked. If the balance is sufficient, the transaction will be
approved while the host system will return the authorization approval to the card and the
money is disbursed from the primary account; but the Electronic Cash Balance still remain
unchanged (please see “Example 1: For authorization to primary account transaction, the
authorized amount is RMB 20 Yuan”);
——Issuer loads to cardholder’s Electronic Cash account automatically. Issuer will activate
“auto-load” process each time during an online processing or when the Electronic Cash
Balance is lower than the Electronic Cash reset threshold..(please see “Example 2: During
online authorization, issuer loads to Electronic Cash account automatically until the
Electronic Cash balance is RMB 50 );
The processing results of the host system as above are shown in the following figures:
Before Transaction
EC Balance=10
Transaction Onlin
Amount of RMB e auth
oriza
tion r
20 Yuan eques
t
The Host system checks The
primary account balance, and
authorized and sends ARPC
tion val
riza o
u tho appr
A se =
The Card authenticates the po n
res
issuer, and confirms
authorization approval,
but not updates the offline
counter.
After Transaction
EC Balance=10
Example 2: the Issuer automatically loads the Electronic Cash Balance to RMB 50 during
the online authorization
Before Transaction
Primary Account
Balance=80
40
EC Account Balance=50
Primary Account Balance=40
EC Balance=10
After Transaction
Primary Account
Balance=20
This Appendix contains functional requirements for the balance of the financial IC card
including the electronic cash and the card log reader.
H.1 Overview
—— Business requirements;
—— Security requirements.
Electronic Cash balance can meet these requirements in the following methods:
—— Increasing the flexibility for members to manage the risk in offline transactions.
The cardholder may use a portable and low-cost personal device to check the Electronic Cash
Balance, or the transaction log on the card. In this way, the personal device may facilitate the
electronic cash solution to meet those demands.12)
Personal device (card reader) must meet the following business requirements:
—— The Card reader should be cheap, with self-contained power supply and normal life cycle
over five years;
—— The Card reader may provide some other characteristics except for this specification.
The below types of personal device must support the functions listed in Table H.1.
Functions
12)
This personal device is not only for Electronic Cash, but for other applications since it is in accordance
with CUP’s IC card enterprise standards.
—— Balance, currency and transaction log must accurately reflect the data in card.
—— If the device allows software upgrades, there should be some mechanism to ensure
the primitively and integrity of the device, and upgrades must be reviewed and
approved prior to installation;
—— Card reader must not retain or display any card-related information after the card has
been removed.
Electronic Cash balance is usually used GET DATA command to read balance from card.
2. Select application;
In addition, card reader must be able to read currency code from the card and convert it into text
format.
Please refer to Table H.2 for the procedure of displaying transaction log.
Step Action
2 Card reader reads a series of tags representing log format and currency type from card
3 Card reader uses a sequence of READ RECORD commands to read logs from card
All items should be displayed by scrolling; specific format and method should be defined by
Issuers and will not be elaborated here.
Table H.3 shows the tags that must be defined in card reader in order to complete the
processings for getting Electronic Cash balance.
9F79 B EC balance
To execute "read Electronic Cash balance" processing, card reader will perform the following
steps:
1. Card reader selects card application. If the return code of card application is not
"successful", the card reader will terminate "get Electronic Cash balance" process and
generate "card not accepted" as a return code;
2. Card reader uses GET DATA command to get Electronic Cash balance. Please refer to
Table H.4 for the definition of GET DATA command.
Code Value
CLA 80
INS CA
P1 9F
P2 79
LE 00
3. If the return status bit of GET DATA command is not "9000", the card reader will
terminate "get Electronic Cash balance" process and generate "card not accepted" as a
return code;
4. Card reader checks the returned Electronic Cash balance through the verification tag
"9F79". If the card does not return an Electronic Cash balance, the card reader will
terminate "get Electronic Cash balance" process and generate "card not accepted" as a
return code.
There is no recommended method for displaying data and it is strictly depends on the capability
of display feature. The following recommendations are for guidance only:
—— The balance should be shown in the format of 3-letter currency code and balance, and be
formatted according to decimal points;
—— If currency (currency symbol) and balance cannot be displayed at the same time due to
limitation of display size, the reader should display the balance first and follows by
currency (currency symbol) shortly afterward, and then it should be switched each other
in display.
If the display string does not support the characters required by currency code, currency code
should be used 3 spaces instead.
Card reader reads transaction logs from card during "read transaction log" process.
Table H.5 shows the tags that must be defined by terminal to complete reading transaction log
process.
84 B DF name
The following output parameters are returned during "read transaction log" process:
Transaction log is defined in the form of recording list. The first record contains the last
(transaction) record written into file. Given the length of each record is M, Table H.6 describes
how the transaction log is defined.
… …
3 Transaction date
3 Transaction time
6 Authorized amount
6 Other amount
20 Merchant name
1 Transaction type
1. Card reader selects card application. If the returned code from card application is not
"successful", the card reader will terminate the process of reading transaction log and
generate the return code "card not accepted". Otherwise, the FCI data from SELECT
command indicates the transaction log is existed or not and maximum number to be
recorded potentially;
2. Card reader sends GET DATA command to get transaction log format (Through tag
"9F4F"). Table H.8 describes the applicable commands;
Code Value
CLA 80
INS CA
P1 9F
P2 4F
Le 00
3. If the returned status bit of GET DATA command is not "9000", the card reader will
generate return code "card not accepted" and terminate "read transaction log" process;
4. Card reader verifies the log format (tag "9F4F"). If that is not exist, the card reader will
generate return code "card not accepted" and terminate "read transaction log" process;
5. Card reader checks the log format contains the tags that are required to display. If they are
not contain the required tags, the card reader will generate return code "card not accepted"
and terminate "read transaction log" process;
6. Card reader sends "read record" command to read the next record in transaction log (files
with short file identifier (SFI) equals to "OB"). Please refer to Table H.9 for the command
format for acquiring log items;
Code Value
CLA 00
INS B2
P1 n (Record No.)
P2 5C
Le 00
7. If the returned status bit is not "9000" or "6A83", the card reader will generate return code
"card not accepted" and terminate "read transaction log" process;
8. If card reader returns the status bits "6A83", it indicates the card reader has read all
meaningful records from card transaction log;
9. If the length of returned data is not as expected, the card reader will generate return code
"card not accepted" and terminate "read transaction log" process; If the length of returned
data is as expected, the card reader will copy the response message to the output string of
transaction log;
10. Card reader continues to read the next log item until all transaction records are read.
Card reader uses "display transaction log" to display transaction logs from card through "read
transaction log" processing.
There are 2 input parameters are used for the display transaction log processing:
—— A binary string of at least 200 bytes that contains transaction log items.
The number of transaction log items is defined by FCI tag and it indicates the size of transaction
log. Please refer to Appendix B.1 in Part 3 of UnionPay Integrated Circuit Card Specifications -
Basic Specifications for relevant definition.
The only output parameter in "display transaction log" process is the return code. The value of
this return code is "successful" or "failed".
The card reader performs the following actions to display transaction log:
1. If the number of transaction log items is "0", card reader will prompt cardholder that there
is currently no information in transaction log and terminate the display transaction log
process;
2. If there is information in transaction log, card reader will get the following information
from each transaction log item:
—— Transaction date;
—— Transaction time;
—— Authorized amount;
—— Other amount;
—— Merchant name;
—— Transaction type;
3. If bit b8 and b7 of cryptogram information data (CID) are set to ‘00', the card reader will
refuse the transaction for this record and will not display its transaction log details. The
card reader will continue to process the next item;
4. It is recommended the card reader should structure its display string to contain the
following data elements:
—— Transaction date;
—— Transaction currency code: card reader should convert currency code from
numeric code to letter code before displaying it to cardholders (and should be in
accordance with ISO 4217);