Difference between e-wallet and e-cash in PBOC/EMV>

Source: Internet
Author: User

 

A previous article <differences between e-wallet and e-cash in PBOC/EMV> has introduced e-cash. This article is from the developer's perspective, this article discusses the application of e-cash in depth.

 

To make an electronic cash transaction, the first step is to select the current application by calling the SELECT command and passing in the current application AID number. If the card status code returns 9000, indicates that the selection is successful. the following is an example:

Sent: 00 A4 04 00 08 A0 00 00 04 44 01 01 05 00

Card return:

6f 45 84 08 A0 00 00 04 44 01 01 05 A5 39 50 0a 50 42 4f 43 20 44 45 42 49 54 01 01 01 9f 38 09 9f 7A 01 9f 02 06 5f 2a 02 5f 2D 02 7A 68 9f 11 01 9f 12 0a 50 42 4f 43 20 44 45 42 49 54 BF 0C 05 9f 4D 02 0b 0a 90 00

 

Let's take a look at the sent command. The eight bytes A0 00 00 04 44 01 01 05 are the aid number of the current application. the last two bytes returned by the card are 90 00, indicating that the sending is successful. the status code is a data field. the data domain is a TLV-structured FCI, where V may also contain TLV-structured data. Therefore, FCI may be a nested TLV structure. 6f is the tag of the entire data domain, which identifies the entire FCI of the card response. 45 indicates the length (in hexadecimal format), that is, the number of all bytes in the data field.

 

If you do not analyze all the data, just let us talk about the important data pdol. pdol in it, which indicates the data that the card requires the terminal to provide, so as to activate the selected application and find this data string;

9f 38 09 9f 7A 01 9f 02 06 5f 2a 02

9f38 is the pdol tag, and 09 indicates the length. 9f 7A 01 indicates that the card requires the terminal to provide the value of the element whose tag is 9f7a, the length is 01, and 9f 02 06 indicates that the card requires the terminal to provide the value of the element whose tag is 9f02, And the length is 06, 5f 2a 02 indicates that the card requires the terminal to provide the value of the element whose tag is 5f2a. The length is 02. the meanings of these three tags are as follows:

9f7a: electronic cash terminal indicator

9f02: Authorization amount

5f2a: transaction currency code

For e-cash-based applications, these three elements are essential, or cards require the terminal to provide at least the values of these three elements.

 

The next step is to send the above three elements to the card through the GPO command.

The next two elements are relatively easy to fill in. The authorization amount is your actual transaction amount. The transaction currency code is fixed to 0156. What is the value of the electronic cash terminal indicator?

 According to the PBOC 2.0 specification, the electronic cash terminal indicator value can be 1 only when the following three conditions are met, otherwise 0. The three conditions are:

1 terminal supports electronic cash transactions

2. The authorization amount is less than the terminal transaction quota.

3. Terminal transaction type: Consumption transaction

The first two conditions are easy to understand. Why is there a third condition?

If the value of the electronic cash terminal indicator received by a card is 1, it considers that the current transaction is an electronic cash transaction, rather than a normal debit transaction, then, in the response to the GPO command, it will return the AIP and AFL of the electronic cash, rather than the AIP and AFL of the ordinary debit card. The difference between the two is mainly in the AFL. if a card is considered to be an electronic cash transaction, it will return the "Electronic Cash Issuing Bank authorization code" to the terminal ",The authorization code of the electronic cash issuing bank is used for offline transactions and stored in the authorization code of the clearing message. The consumption transaction of PBOC is offline transaction, which is why there is a third condition.


In addition, PBOC's deposit transaction rules must be processed online, so we can also conclude that for electronic cash-based deposit transactions, the data it reads from AFL people is actually the data of ordinary lending records, the transaction process is also the debit process.

 

The following is a test on an e-cash card. If the e-cash terminal indicator value is 0, the returned AFL is as follows:

08 01 02 00,10 01 03 01,18 01 02 00,20 01 01 00

When the electronic cash terminal indicator value is 1, the GPO command returns the following six groups of AFL

08 01 02 00,10 05 06 01,10 08 08 00,18 01 02 00,20 01 01 00,28 01 01 00

The authorization code of the e-cash issuing bank is the file with the File Identifier 28.

 

If the terminal can receive the AIP and AFL returned by the card, it can read all the data that the card provides to the terminal based on the AFL provided by the card and store it on the terminal for future transactions. the data includes card data such as the Pan number. For example, the value of the authorization code (TAG = 9f74) read by the test card s is as follows: 45 43 43 30 31, the corresponding ASCII character is ecc001.

 

Write it here first.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.