ISO 8583
ISO 8583 — стандарт ISO, описывающий процесс передачи и формат финансовых сообщений (транзакций) систем, обрабатывающих данные платёжных карт.
Введение
Транзакция данных платёжных карт (например, для запроса авторизации держателя карты) начинается с устройства, её инициировавшего, например c POS-терминала, проходит через ряд сетей и заканчивается на системе, которая выпустила карту.
Транзакционные данные включают в себя:
- информацию о карте (например, account number)
- информацию о терминале (например, номер "мерчанта")
- собственно финансовая информация (например, the amount)
Система, которая выпустила карту, авторизует транзацию либо отклоняет её и генерирует ответное сообщение, которе возвращается на терминал.
ISO 8583 описывает формат транзакций и механизм их передачи ("communication flow") таким образом, чтобы различные системы могли обмениваться этими транзакциями. Большинство транзакций, которые выполняются с банкоматов, используют ISO 8583 в некоторых аспектах коммуникационной цепочки, как то например, транзакции, выполняющиеся при оплате покупателем товара в магазине. Такие международные платёжные системы как MasterCard и Visa используют стандарт ISO 8583 при авторизационных взаимодействиях.
ISO 8583 описывает транзакции, инициированные держателем карты, такие как покупка, снятие наличных, пополнение счёта, оплату, аннулирование операции, запрос баланса, платежи и переводы со счёта на счёт. ISO 8583 также описывает сообщения между системами для обмена ключами безопасности, согласования итогов и сообщения для других административных целей.
Несмотря на то, что ISO 8583 определяет общий стандарт, как правило, он не используется напрямую в системах или сетях. Вместо этого каждая сеть адаптирует стандарт для собственных нужд, пользуясь отдельными полями и вариантами использования.
Положение полей различается в разных версиях стандарта. К примеру, отдельные элементы, определяющие валюту в версиях 1987 и 1993 более не используются в версии 2003, где валюта является составной частью элемента, определяющего сумму. ISO 8583:2003 нужно время для достижения широкого признания.
Сообщение ISO 8583 состоит из следующих частей:
- Message Type Indicator (MTI) - Индикатор типа сообщения;
- Одна или несколько битовых карт, указывающие, какие элементы данных присутствуют в сообщении;
- Элементы данных, поля сообщения.
Индикатор типа сообщения
Индикатор типа сообщения (англ. Message Type Indicator (MTI)) - 4 значное числовое поле, которое определяет высокоуровневую функцию сообщения. Индикатор типа сообщения включает в себя версию стандарта ISO 8583, класс сообщения, функцию сообщения и источник сообщения, описанные ниже.
Пример: 0110
0xxx -> версия стандарта ISO 8583 (версия 1987 года) x1xx -> класс сообщения (сообщение авторизации) xx1x -> функция сообщения (запрос-ответ) xxx0 -> кто начал взаимодействие (эквайер)
ISO 8583 версия
Первая позиция MTI определяет версию стандарта ISO 8583, используемую для передачи сообщения.
Позиция | Значение |
---|---|
0xxx | Версия ISO 8583-1:1987 |
1xxx | Версия ISO 8583-2:1993 |
2xxx | Версия ISO 8583-1:2003 |
9xxx | Частное использование |
Класс сообщения
Position two of the MTI specifies the overall purpose of the message.
Position | Meaning | Usage |
---|---|---|
x1xx | Authorization Message | Determine if funds are available, get an approval but do not post to account for reconciliation, Dual Message System (DMS), awaits file exchange for posting to account |
x2xx | Financial Message | Determines if funds are available, get an approval and post directly to the account, Single Message System (SMS), no file exchange after this |
x3xx | File Actions Message | Used for hot-card, TMS and other exchanges |
x4xx | Reversal Message | Reverses the action of a previous authorization |
x5xx | Reconciliation Message | Transmits settlement information |
x6xx | Administrative Message | Transmits administrative advice. Often used for failure messages (e.g. message reject or failure to apply) |
x7xx | Fee Collection Message | |
x8xx | Network Management Message | Used for secure key exchange, logon, echo test and other network functions |
x9xx | Reserved by ISO |
Функция сообщения
Position three of the MTI specifies the message function which defines how the message should flow within the system. Requests are end-to-end messages (e.g., from acquirer to issuer and back with timeouts and automatic reversals in place), while advices are point-to-point messages (eg, from terminal to acquirer, from acquirer to network, from network to issuer, with transmission guaranteed over each link, but not necessarily immediately).
Position | Meaning |
---|---|
xx0x | Request |
xx1x | Request Response |
xx2x | Advice |
xx3x | Advice Response |
xx4x | Notification |
xx8x | Response acknowledgment |
xx9x | Negative acknowledgment |
Источник сообщения
Position four of the MTI defines the location of the message source within the payment chain.
Position | Meaning |
---|---|
xxx0 | Acquirer |
xxx1 | Acquirer Repeat |
xxx2 | Issuer |
xxx3 | Issuer Repeat |
xxx4 | Other |
xxx5 | Other Repeat |
Примеры
Bearing each of the above four positions in mind, an MTI will completely specify what a message should do, and how it is to be transmitted around the network. Unfortunately, not all ISO 8583 implementations interpret the meaning of an MTI in the same way. However, a few MTIs are relatively standard:
MTI | Meaning | Usage |
---|---|---|
0100 | Authorization request | Request from a point-of-sale terminal for authorization for a cardholder purchase |
0120 | Authorization Advice | When the Point of Sale device breaks down and you have to sign a voucher |
0121 | Authorisation Advice Repeat | if the advice times out |
0200 | Acquirer Financial Request | Request for funds, typically from an ATM |
0220 | Acquirer Financial Advice | e.g. Checkout at a hotel |
0221 | Acquirer Financial Advice repeat | if the advice times out |
0400 | Acquirer Reversal Request | Reverses a transaction |
0420 | Acquirer Reversal Advice | Advises that a reversal has taken place |
0421 | Acquirer Reversal Advice Repeat Message | if the reversal times out |
0800 | Network Management Request | Echo test, logon, log off etc |
0820 | Network Management Advice | Keychange |
Побитовые карты
В соответствии с ISO 8583, побитовая карта — это поле или подполе внутри сообщения, показывающие какие элементы данных представлены в другом месте сообщения.
Сообщение содержит как минимум одну битовую карту, которая называется Primary Bitmap (англ. Первичная битовая карта), определяющую, какие из элементов данных с номерами от 1 до 64 присутствуют в сообщении. Как правило, если вторая битовая карта присутствует, то размещается в качестве первого элемента данных и определяет, какие из элементов данных с номерами от 65 до 128 присутствуют в сообщении. Аналогично, третья битовая карта может использоваться для определения наличия или присутствия элементов со 129 до 192, впрочем, они используются редко.
Битовые карты могут быть переданы как 8 байт двоичной информации или как 16 шестнадцатеричных символов (0-9, A-F) из наборов ASCII или EBCDIC.
Поле присутствует, когда соответствующий бит битовой карты имеет значение «истина», например, байт '10000010' означает, что поля 1 и 7 присутствуют в сообщении.
Примеры
Bitmap | Defines presence of |
---|---|
4210001102C04804 | Fields 2, 7, 12, 28, 32, 39, 41, 42, 50, 53, 62 |
7234054128C28805 | Fields 2, 3, 4, 7, 11, 12, 14, 22, 24, 26, 32, 35, 37, 41, 42, 47, 49, 53, 62, 64 ,100 (Secondary Bitmap required to show the presence of field — 100) |
8000000000000001 | Field 1, 64 |
0000000000000003 (secondary bitmap) |
Fields 127, 128 |
Explanation of Bitmap field 4210001102C04804
01000010 = 42x (counting from the left, the second and seventh bits are 1, indicating that fields 2 and 7 are present)
00010000 = 10x (field 12 is present)
00000000 = 00x (no fields present)
00010001 = 11x (fields 28 and 32 are present)
00000010 = 02x (field 39 is present)
11000000 = C0x (fields 41 and 42 are present)
01001000 = 48x (fields 50 and 53 are present)
00000100 = 04x (field 62 is present)
0________10________20________30________40________50________60__64
1234567890123456789012345678901234567890123456789012345678901234 n-th bit
0100001000010000000000000001000100000010110000000100100000000100 bit map
Fields present in variable length message record:
2-7-12-28-32-39-41-42-50-53-62
Элементы данных
Элементы данных - это отдельные поля, содержащие информацию о транзакции. Исходный стандарт ISO 8583:1987 был рассчитан на возможность включения 128 элементов данных, а в последующих версиях было определено до 192 элементов данных. В ревизии 1993 года были введены новые описания, удалены некоторые старые, при этом формат как таковой не претерпел изменений.
Несмотря на то, что каждый элемент данных имеет описанное значение и формат, стандарт включает некоторые элементы данных для общих целей, а также специфические для системы (или страны) элементы данных, которые могут иметь огромные различия в разных реализациях.
Each data element is described in a standard format which defines the permitted content of the field (numeric, binary, etc) and the field length (variable or fixed), according to the following table:
Abbreviation | Meaning |
---|---|
a | Alpha, including blanks |
n | Numeric values only |
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 in ISO 4909 and ISO 7813 |
. 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. |
Additionally, each field may be either fixed or variable length. If variable, the length of the field will be preceded by a length indicator.
Type | Meaning |
---|---|
Fixed | no field length used |
LLVAR or (..xx) | Where LL < 100, means two leading digits LL specify the field length of field VAR |
LLLVAR or (...xxx) | Where LLL < 1000, means three leading digits LLL specify the field length of field VAR |
LL and LLL are hex or ASCII. A VAR field can be compressed or ASCII depending of the data element type. | LL can be 1 or 2 bytes. For example, if compressed as one hex byte, '27x means there are 27 VAR bytes to follow. If ASCII, the two bytes '32x, '37x mean there are 27 bytes to follow. 3 digit field length LLL uses 2 bytes with a leading '0' nibble if compressed, or 3 bytes if ASCII. The format of a VAR data element depends on the data element type. If numeric it will be compressed, e.g. 87456 will be represented by 3 hex bytes '087456x. If ASCII then one byte for each digit or character is used, e.g. '38x, '37x, '34x, '35x, '36x. |
Data Element | Type | Usage |
---|---|---|
1 | b 64 | Bit Map Extended |
2 | n ..19 | Primary account number (PAN) |
3 | n 6 | Processing code |
4 | n 12 | Amount, transaction |
5 | n 12 | Amount, Settlement |
6 | n 12 | Amount, cardholder billing |
7 | n 10 | Transmission date & time |
8 | n 8 | Amount, Cardholder billing fee |
9 | n 8 | Conversion rate, Settlement |
10 | n 8 | Conversion rate, cardholder billing |
11 | n 6 | Systems trace audit number |
12 | n 6 | Time, Local transaction |
13 | n 4 | Date, Local transaction |
14 | n 4 | Date, Expiration |
15 | n 4 | Date, Settlement |
16 | n 4 | Date, conversion |
17 | n 4 | Date, capture |
18 | n 4 | Merchant type |
19 | n 3 | Acquiring institution country code |
20 | n 3 | PAN Extended, country code |
21 | n 3 | Forwarding institution. country code |
22 | n 3 | Point of service entry mode |
23 | n 3 | Application PAN number |
24 | n 3 | Function code(ISO 8583:1993)/Network International identifier (NII) |
25 | n 2 | Point of service condition code |
26 | n 2 | Point of service capture code |
27 | n 1 | Authorizing identification response length |
28 | n 8 | Amount, transaction fee |
29 | n 8 | Amount. settlement fee |
30 | n 8 | Amount, transaction processing fee |
31 | n 8 | Amount, settlement processing fee |
32 | n ..11 | Acquiring institution identification code |
33 | n ..11 | Forwarding institution identification code |
34 | n ..28 | Primary account number, extended |
35 | z ..37 | Track 2 data |
36 | n ...104 | Track 3 data |
37 | an 12 | Retrieval reference number |
38 | an 6 | Authorization identification response |
39 | an 2 | Response code |
40 | an 3 | Service restriction code |
41 | ans 8 | Card acceptor terminal identification |
42 | ans 15 | Card acceptor identification code |
43 | ans 40 | Card acceptor name/location |
44 | an ..25 | Additional response data |
45 | an ..76 | Track 1 Data |
46 | an ...999 | Additional data - ISO |
47 | an ...999 | Additional data - National |
48 | an ...999 | Additional data - Private |
49 | a 3 | Currency code, transaction |
50 | an 3 | Currency code, settlement |
51 | a 3 | Currency code, cardholder billing |
52 | b 16 | Personal Identification number data |
53 | n 18 | Security related control information |
54 | an 120 | Additional amounts |
55 | ans ...999 | Reserved ISO |
56 | ans ...999 | Reserved ISO |
57 | ans ...999 | Reserved National |
58 | ans ...999 | Reserved National |
59 | ans ...999 | Reserved for national use |
60 | an .7 | Advice/reason code (private reserved) |
61 | ans ...999 | Reserved Private |
62 | ans ...999 | Reserved Private |
63 | ans ...999 | Reserved Private |
64 | b 16 | Message authentication code (MAC) |
65 | b 16 | Bit map, tertiary |
66 | n 1 | Settlement code |
67 | n 2 | Extended payment code |
68 | n 3 | Receiving institution country code |
69 | n 3 | Settlement institution county code |
70 | n 3 | Network management Information code |
71 | n 4 | Message number |
72 | ans ...999 | Data record (ISO 8583:1993)/n 4 Message number, last(?) |
73 | n 6 | Date, Action |
74 | n 10 | Credits, number |
75 | n 10 | Credits, reversal number |
76 | n 10 | Debits, number |
77 | n 10 | Debits, reversal number |
78 | n 10 | Transfer number |
79 | n 10 | Transfer, reversal number |
80 | n 10 | Inquiries number |
81 | n 10 | Authorizations, number |
82 | n 12 | Credits, processing fee amount |
83 | n 12 | Credits, transaction fee amount |
84 | n 12 | Debits, processing fee amount |
85 | n 12 | Debits, transaction fee amount |
86 | n 15 | Credits, amount |
87 | n 15 | Credits, reversal amount |
88 | n 15 | Debits, amount |
89 | n 15 | Debits, reversal amount |
90 | n 42 | Original data elements |
91 | an 1 | File update code |
92 | n 2 | File security code |
93 | n 5 | Response indicator |
94 | an 7 | Service indicator |
95 | an 42 | Replacement amounts |
96 | an 8 | Message security code |
97 | n 16 | Amount, net settlement |
98 | ans 25 | Payee |
99 | n ..11 | Settlement institution identification code |
100 | n ..11 | Receiving institution identification code |
101 | ans 17 | File name |
102 | ans ..28 | Account identification 1 |
103 | ans ..28 | Account identification 2 |
104 | ans ...100 | Transaction description |
105 | ans ...999 | Reserved for ISO use |
106 | ans ...999 | Reserved for ISO use |
107 | ans ...999 | Reserved for ISO use |
108 | ans ...999 | Reserved for ISO use |
109 | ans ...999 | Reserved for ISO use |
110 | ans ...999 | Reserved for ISO use |
111 | ans ...999 | Reserved for ISO use |
112 | ans ...999 | Reserved for national use |
113 | n ..11 | Authorizing agent institution id code |
114 | ans ...999 | Reserved for national use |
115 | ans ...999 | Reserved for national use |
116 | ans ...999 | Reserved for national use |
117 | ans ...999 | Reserved for national use |
118 | ans ...999 | Reserved for national use |
119 | ans ...999 | Reserved for national use |
120 | ans ...999 | Reserved for private use |
121 | ans ...999 | Reserved for private use |
122 | ans ...999 | Reserved for private use |
123 | ans ...999 | Reserved for private use |
124 | ans ...255 | Info Text |
125 | ans ..50 | Network management information |
126 | ans .6 | Issuer trace id |
127 | ans ...999 | Reserved for private use |
128 | b 16 | Message Authentication code |
Примеры
Field Definition | Meaning |
---|---|
n6 | Fixed length field of six digits |
n.6 | LLVAR numeric field of up to 6 digits in length |
a..11 | LLVAR alphanumeric field of up to 11 characters in length |
b...999 | LLLVAR binary field of up to 999 bytes in length |
Ссылки
- DL-ISO-8583 Open-source implementation, written in C(англ.)
- GPL'd ISO8583 Framework(англ.)
- .NET ISO-8583 Framework(англ.)
- jPOS ISO-8583 Framework in Java(англ.)
- ISO-8583 '93 based POS Terminal - HOST protocol (итал.)(англ.)
- iso8583.info FREE OnLine ISO 8583:1987 & ISO 8583:1993 messages encoder and decoder(англ.)(рус.)
ar:أيزو 8583 de:ISO 8583 en:ISO 8583 es:ISO 8583 pt:ISO 8583
Если вам нравится SbUP.com Сайт, вы можете поддержать его - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 и ещё....