Encoding of field values
BIN – Binary Fields
Values for binary are simply copied 1:1 into the data stream.
CNSTR – Constructed Fields
Constructed fields are tags that contain several tags inside.
TIME – Date/Time Fields
For each date/time field, a specific format is specified. The result value is encoded in the binary coded decimal format. During onboarding, the time zone of the payment terminal is configured in the CM.com IPP Payments Platform. The time zone used by the terminal must respect the configured time zone at all times.
Examples
DATE
The date January 31, 2011 in format yyMMdd is encoded in three bytes: 0x11 0x01 0x31.
TIME
The time 14:51:44 in format HHmmss is encoded in three bytes: 0x14 0x51 0x44.
BOOL – Boolean Fields
A Boolean is encoded as one byte, with 0x00 representing 'false' and 0x01 representing 'true'.
INT – Integer or Numeric Fields
Integers are encoded in the binary coded decimal format (aligned right), in the minimum number of bytes required (or at a maximum 4). E.g. 123 is encoded as 0x01 0x23.
LONG – Long or Numeric Fields
Long fields are encoded in the binary coded decimal format (aligned right), similar to integer fields (but at maximum 8 bytes).
TEXT – Text Fields
Texts are encoded in the ASCII character set. For fixed length fields, texts are aligned left and padded with spaces.
E.g. “Test” is encoded as 0x56 0x49 0x53 0x41.
Amount display string
Readable text string presenting the amount.
Format: [ISO4217 currency code][space][decimal number in default number of the currency’s fraction digits separated by a decimal separator depending on the locale].
Examples:
12345,78 Euro in the Netherlands => "EUR 12345,78"
12345,78 Euro in the United Kingdom => "EUR 12345.78"
12345,78 Bahraini Dinar in Germany => "BHD 12345,780"
12345,78 Bahraini Dinar in UnitedStates => "BHD 12345.780"
Binary coded decimal
Track2Data is encoded in the binary coded decimal (BCD) format, with the 0xD nibble as a Pan separator, and a 0xF nibble as a padding character when the total number of nibbles is not even.
It is recommended to omit the following fields from track2:
-
Start sentinel
-
End sentinel
-
Longitudinal redundancy check (LRC).
E.g. pan 6799998900000200010, expiration date December 2014, service code 620 and 16293042 as discretionary data are to be encoded as:
0x67 0x99 0x99 0x89 0x00 0x00 0x02 0x00 0x01 0x0d 0x14 0x12 0x62 0x01 0x62 0x93 0x04 0x2F
Hexadecimal ASCII
Track2Data is encoded in hexadecimal ASCII values. For the exact example above mentioned, pan 6799998900000200010, expiration date December 2014, service code 620 and 16293042 as discretionary data are to be encoded as:
0x36 0x37 0x39 0x39 0x39 0x39 0x38 0x39 0x30 0x30 0x30 0x30 0x30 0x32 0x30 0x30 0x30 0x31 0x30 0x3d 0x31 0x34 0x31 0x32 0x36 0x32 0x30 0x31 0x36 0x32 0x39 0x33 0x30 0x34 0x32 0x46
Special Fields
This section will contain complementary descriptions in case any tag needs it.
Acquirer Data (5FE33A)
The acquirer data tag is a proprietary field of CM.com. Terminal vendors may ignore the value receive in this tag.