Bitmap Elements
Table of Bitmap Elements
| Bit | Name | Format | Attribute | |
|---|---|---|---|---|
| 1 | Bit Map, Extended (0 –> 8 bytes, 1 –> 16 bytes) | b | 1 | |
| 2 | Primary Account Number (CardHolder Number) | LLVAR | n | ..19 |
| 3 | Processing Code | n | 6 | |
| 4 | Amount, Transaction | n | 12 | |
| 5 | Amount, Settlement | n | 12 | |
| 6 | Amount, CardHolder Billing | n | 12 | |
| 7 | Transmission Date and Time | MMDDhhmmss | n | 10 |
| 8 | Amount, CardHolder Billing fee | n | 8 | |
| 9 | Conversion rate, Settlement | n | 8 | |
| 10 | Conversion rate, CardHolder Billing | n | 8 | |
| 11 | System Trace Audit number (STAN) | n | 6 | |
| 12 | Time, Local Transaction | hhmmss | n | 6 |
| 13 | Date, Local Transaction | MMDD | n | 4 |
| 14 | Date, Expiration (Card Expire date) | YYMM | n | 4 |
| 15 | Date, Settlement | MMDD | n | 4 |
| 16 | Date, Conversion | MMDD | n | 4 |
| 17 | Date, Capture | MMDD | n | 4 |
| 18 | Merchant's Type | n | 4 | |
| 19 | Acquiring Institution Country | n | 3 | |
| 20 | Primary Account Number Extended, Country Code | n | 3 | |
| 21 | Forwarding Institution Country Code | n | 3 | |
| 22 | Point Of Service Entry Mode (POS Entry Mode) | n | 3 | |
| 23 | Card Sequence Number | n | 3 | |
| 24 | Network International Identifier (NII) | n | 3 | |
| 25 | Point Of Service Condition Code (POS Condition Code) | n | 2 | |
| 26 | Point Of Service PIN Capture Code (POS PIN Capture Code) | n | 2 | |
| 27 | Authorization Identification Response Length | n | 1 | |
| 28 | Amount, Transaction Fee | x+n | 8 | |
| 29 | Amount, Settlement Fee | x+n | 8 | |
| 30 | Amount, Transaction Processing Fee | x+n | 8 | |
| 31 | Amount, Settlement Processing Fee | x+n | 8 | |
| 32 | Acquiring Institution Identification Code | LLVAR | n | ..11 |
| 33 | Forwarding Institution Identification Code | LLVAR | n | ..11 |
| 34 | Primary Account Number Extended | LLVAR | ns | ..28 |
| 35 | Track 2 data | LLVAR | z | ..37 |
| 36 | Track 3 data | LLLVAR | z | ...104 |
| 37 | Retrival Reference Number | an | 12 | |
| 38 | Authorization Identification Response | an | 6 | |
| 39 | Response Code | an | 2 | |
| 40 | Service Restriction Code | an | 3 | |
| 41 | Card Acceptor Terminal Identification (TID) | ans | 8 | |
| 42 | Card Acceptor Identification Code (MID) | ans | 15 | |
| 43 | Card Acceptor Name/Location | ans | 40 | |
| 44 | Additional Response data | LLVAR | ans | ..25 |
| 45 | Track 1 data | LLVAR | ans | ..76 |
| 46 | Additional data – ISO | LLLVAR | ans | ...999 |
| 47 | Additional data – National | LLLVAR | ans | ...999 |
| 48 | Additional data – Private | LLLVAR | ans | ...999 |
| 49 | Currency code, Transaction | a or n | 3 | |
| 50 | Currency code, Settlement | a or n | 3 | |
| 51 | Currency code, CardHolder Billing | a or n | 3 | |
| 52 | Personal Identification Number (PIN) | b | 64 | |
| 53 | Security Related Control Information | b | 16 | |
| 54 | Additional Amounts | LLVAR | an | ..120 |
| 55 | EMV Data | LLLVAR | ans | ...999 |
| 56 | Reserved, ISO | LLLVAR | ans | ...999 |
| 57 | Reserved, National | LLLVAR | ans | ...999 |
| 58 | Reserved, National | LLLVAR | ans | ...999 |
| 59 | Reserved, National | LLLVAR | ans | ...999 |
| 60 | Reserved, Private | LLLVAR | ans | ...999 |
| 61 | Reserved, Private | LLLVAR | ans | ...999 |
| 62 | Reserved, Private | LLLVAR | ans | ...999 |
| 63 | Reserved, Private | LLLVAR | ans | ...999 |
| 64 | Message Authentication Code Field (MAC) | b | 64 |
Data Elementsopen in new window
| Abbreviation | Meaning |
|---|---|
| a | Alpha, including blanks |
| n | Numeric values only |
| x+n | Numeric (amount) values, where the first byte is either 'C' to indicate a positive or Credit value, or 'D' to indicate a negative or Debit value, followed by the numeric value (using n digits) |
| s | Special characters only |
| an | Alphanumeric |
| as | Alpha & special characters only |
| ns | Numeric and special characters only |
| ans | Alphabetic, numeric and special characters. |
| b | Binary data |
| z | Tracks 2 and 3 code set as defined inopen in new window ISO/IEC 7813open in new window and ISO/IEC 4909 respectively |
| . or .. or ... | variable field length indicator, each . indicating a digit. |
| x or xx or xxx | fixed length of field, or maximum length in the case of variable length fields. |
Build Format
LLVAR
This function below use on n, an, ans and z type
private fun llvarCodecType(data: String?, length: Int): String {
// Find length from HEX string
val dataLength = data!!.length / 2
// Check length size less than max of bit
if (dataLength <= length) {
// Check mod 2
return if (data.length.mod(2) != 0) {
// If mod 2 not equal 0 to add F at last of data and add length of message
(dataLength).toString() + data + "F"
} else {
// If mod 2 equal 0 to add length of message only
(dataLength).toString() + data
}
} else {
throw Exception("Data invalid format")
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Example
Data: 410000000
Add F to mod 2 equal 0 : 410000000F
Add length: 05410000000F
1
2
3
4
5
2
3
4
5
LLLVAR
This function below use on n, an, ans and z type
private fun lllvarCodecType(data: String?, length: Int): String {
// Find length from HEX string
val dataLength = data!!.length / 2
// Check length size less than max of bit
if (dataLength <= length) {
return if (dataLength.mod(2) != 0) {
// If mod 2 not equal 0 to add F at last of data and add length of message
(dataLength).toString().padStart(4, '0') + data + "F"
} else {
// If mod 2 equal 0 to add length of message only
(dataLength).toString().padStart(4, '0') + data
}
} else {
throw Exception("Data invalid format")
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Example
Data: 410000000
Add F to mod 2 equal 0 : 410000000F
Add length: 0005410000000F
1
2
3
4
5
2
3
4
5