Payment Service Provider API ISO 8583:1993 (IFSF) H2H description

Last modified by Bjørnar Ruud on 2021/03/18 10:47

Overview

The H2H PayEx link enables authorization and capture of card transactions. Depending on the card, PayEx is either a PSP or the end host (card issuer). The third party host acts as a gateway between payment terminals and PayEx.

architecture.png

The third party host can be a single or dual host system.
PayEx has a fully redundant system, with an active/active configuration.
The third party host(s) connects to a load balancer at PayEx.

Test system

Our test system is reachable over internet. 

Host: pospaydirecttx.externaltest.payex.com

TCP Port: 9046

For production, secure connection are required. Contact PayEx for production setup.

Supported message types

Message TypeReference
1100/1110AUTHORISATION REQUEST
1200/1210FINANCIAL TRANSACTION REQUEST
1220/1221/1230FINANCIAL TRANSACTION ADVICE
1420/1421/1430REVERSAL ADVICE
1820/1830NETWORK MANAGEMENT
1520/1521/1530RECONCILIATION REQUEST (Currently not supported)
  • Message types included in the table above are  supported unless otherwise specified. E-g reconciliation is not currently supported.
    Use links to different message types for details on specific messages.
    Only the Financial transaction advice (1220), Reversal Advice (1420) use repeat messages(1221 and 1421).  Repeats are to be sent according to rules below.
  • Advice can be declined by PayEx for technical reasons. In this case the third party host need to retry the advice until manual intervention or the advice has been accepted. It’s expected that the third party implement a retry delay with exponential wait period between retires. After 6 retry attempts have failed manual intervention by third party and PayEx support must be initiated.

Message layout

This section covers message types and fields supported by PayEx

PresenceTitleDescription
CConditionalThe data element’s presence depends on specific circumstances, witch are described either directly or by reference in the message content table. 
CEConditional echoThe response message must have the same data element if the data element was present in the original message
MMandatoryData element must be present in the specified message
MEMandatory echoThe response message must have the same data element and value as sent in the original message request or advice message
OOptionalThe data element may or may not be present in the message

Optional fields may always be present in requests, even when not needed. In such case, they will be ignored. Requests received missing a mandatory field will get action code 904 - Format Error.

The third party host must ignore unknown fields included in the response messages.

When no usage notes are given in the field description, the field should be used as described in IFSF [1].

The “Format”-column can contain following info:

  • LL: Variable length field, max 99 bytes as data. The field contains 2 bytes holding the length of the data. Example: 303101 a one byte field with LL = 3031 and the data is 01.
  • LLL: Variable length field, max 999 bytes as data. The field contains 3 bytes holding the length of the data. Example: 30303101 a one byte field with LLL = 303031 and the data is 01.
  • Date/time field formats, YYMMDDhhmmss (or variations), where:
    • YY : Last 2 digits of the year, 00 through 99
    • MM: Month, 01 through 12.
    • DD: Day, 01 through 31
    • hh: Hour, 00 through 23
    • mm: Minutes, 00 through 59
    • ss: Seconds, 00 through 59

The “Type”-column can contain:

  • a : Alphabetic character [a..z,A..Z]
  • n : Numeric BCD-digit. [0..9]
  • ans: alphabetic, numeric and special characters
  • an : alphabetic and numeric.
  • s : Special characters.
  • b : Binary
  • p: pad character, space
  • x: “C” for credit, “D” for debit and shall always be associated with a numerical amount data element.

The “Size”-column can contain:

  • Variable length fields have a size that looks like “..nn”, where nn is the maximum number of characters or bytes.
  • A fixed length field has “n” as size content, with n the number of characters or bytes.

All fixed length “n” data elements are assumed to be right justified with leading zeroes. All other fixed length data elements are left justified with trailing spaces. In all “b” data elements, blocks of 8 bits are assumed to be left justified with trailing zeroes.

Message protocol

All messages are transferred using TCP/IP sockets.

The message will be encapsulated in a transmission frame as follows:

  • The first 4 digits contain the length of the message in ASCII (decimal value, most significant digit first). The length field includes all bytes from the first byte of the message ID up to the last byte of the last field.
  • This 4-digit length field is immediately followed by the message ID, also in ASCII (decimal value, most significant digit first).
  • An 8 byte message bitmap, which is a binary field (not ASCII encoded).
  • Message fields, which could be ASCII or binary encoded. The fields with format ‘n, ns, an, ans, anp or x’ are ASCII encoded, while the fields with format ‘b’ are binary encoded. The following conventions shall be applied to all data elements:
    • All fixed length numeric data element values shall be right justified with leading zeroes.
    • All fixed length data elements with alphabetic or special characters shall be left justified with trailing blanks.
    • All fixed length binary data elements shall be right justified with leading zeroes.
    • The position of a character or a bit in a data element shall be counted from the left beginning with one (1).(See also section 5.1 Attribute specification in [01])
    • No trailer is included.

Example: An imaginary message which consists only of a message ID “0300” and an empty bitmap (all zeros) will be transmitted as follows:
 

Length

Message ID 

Bitmap
0x30 0x30 0x31 0x320x30 0x33 0x30 0x300x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Example: An 1820 message, without MAC, will be transmitted as follows: Message bytes (hex):
303035303138323002300101000000003039313031353238343133383239313030393039313031353238343138333130353130303331

FieldFormatEncodingDataParsed
Message LengthnASCII303035300050
Message IDnASCII313832301820
BitmapbBinary0230010100000000 
7 - Date/TimenASCII303931303135323834310910152841
11 - STANnASCII333832393130382910
12 - Date/TimenASCII303930393130313532383431090910152841
24 - Function codenASCII383331831
33 - Forwarding institution identification codenASCII

30323135

15

The PayEx response timeout is set to 35 seconds. If after 35+1 seconds, no response has been received, the third party host needs to take the appropriate action based on the message type. (E.g. send a reversal)

The third party host has the possibility to perform offline stand-in, thought this needs to be agreed with the individual card issuers. Otherwise the merchant might not be reimbursed.

PIN Validation

PayEx perform online PIN validation on payment cards where PayEx is the acquirer, on all other cartds PIN is validated by the third party acuirer.  PayEx will not interpret P-22 Point-Of-Service code to determine if it needs to validate PIN or not on PayEx fuel cards, but 3rd patry aquirers might so it's good practice to use P-22 correctly. 

Fields required for PIN validation are: 

  • P-48-14 – PIN encryption Methodology
  • P-52 – PIN data
  • P-53 – Security related information

See security documentation for details.

Security documentation

Here you can find details regarding the security elements of this H2H integration.

SECURITY SPECIFICATION

Response codes

Here you can find the response codes which may be returned from PayEx.

RESPONSE CODES

Message field overview

P-3 PROCESSING CODE

Code used to describe the effect of a transaction on the customer account and the accounts affected. Currently fixed 000000 : Goods and services

P-4 AMOUNT, TRANSACTION

The amount is a numeric value, expressed without a decimal separator. Where a minor unit of currency applies, the relevant minor unit data element indicates the number of decimal places in the relevant amount.  Example : NOK 1 = 100

P-7 DATE AND TIME, TRANSMISSION

Date and time of message transmission from the third party host. 

P-11 SYSTEM TRACE AUDIT NUMBER

Number assigned by the third party host to assist in identifying a transaction uniquely. Range from 000001 to 999999. Every message must have a new STAN, repeats use the same STAN as the original message.

P-12 DATE AND TIME, LOCAL TRANSACTION

Date and time of the transaction when performed on the POS. 

P-22 POINT OF SERVICE DATA CODE

A series of codes intended to identify terminal capability, terminal environment and presentation security data.

P-24 FUNCTION CODE

Function codeDescription
101Original authorization, amount estimated used in 1100
200Original financial request/advice Used in 1200/1220/1221
201Previously approved authorisation, amount the same Used in 1220/1221
202Previously approved authorisation, amount differs Used in 1220/1221
400Full reversal Used in 1420/1421
831Echo test Used in 1820

P-25 MESSAGE REASON CODE

reason code Description
1003Card issuer unavailable
1004Terminal processed
1005ICC processed
1508On-line forced by terminal
4000Customer cancellation
4020Invalid response, no action taken
4021Timeout waiting for response
4351Cancellation - unmatched signature

P-30 ORIGINAL AMOUNT

The original amount data element is a constructed element of two parts with a total of 24 positions:
a)    Original amount transaction, n 12;
b)    Original amount reconciliation, n 12.
Absence of data shall be indicated by zeroes. These parts shall be used when attempting to perform a partial approval and shall contain the original amounts.

P-33 FORWARDING INSTITUTION IDENTIFICATION CODE

10 digit code identifying the 3rd patry host. Each 3rd party integrated with PayEx will be assigned a unique code that they are to use in all messages where P-33 is specified. 

P-38 APPROVAL CODE

Code assigned by the authorising institution indicating approval.

P-39 ACTION CODE

See action code page for codes that can be returned by PayEx.

P-41 Card acceptor terminal identification
Needs to be unique per POS terminal at the merchant site.

P-42 Card acceptor identification code

8 digit unique ID provided by PayEx for each merchant. 

P-43 Card acceptor name/location

The name and location of the card acceptor.

P-48 MESSAGE CONTROL DATA ELEMENTS
Used for the control of messages between the POS and the FEP. These are present in field 48 as a variable content data element. It uses a standard bit map to identify the specific data elements present in field 48. The format is LLLVAR with a maximum length of 999. The 8 byte bit map is the first item (element 48-0) in the data element.

P-48-4 BATCH/SEQUENCE NUMBER

This field identifies the transactions associated with a particular settlement period. This number starts at one and increments with each Reconciliation.

P-48-8 CUSTOMER DATA

The customer data is any data entered by the customer or cashier as required by the authorizer to complete the transaction. Transactions requiring customer data may be related to fleet fuelling, cheque authorizations or any other type of retail store management functions. Up to sixteen separate entries are supported. Each entry consists of two elements, the type of customer data entered and the variable length value of the entered data. Successive entries are separated by a back-slash (\). (Note: the LVAR method is not used for these entries.) The entire data element has a maximum length of 250 bytes and is parsed as an LLLVAR field.

ElementNameAttributeDescription
48-8-1Number of customer data fieldsn2Count of customer data entries to follow.Note: this value must be from 1 to 16.
48-8-2Type of customer dataan 1Identifies the type of customer data entered.  (see P48-8-2)
48-8-3Value of customer dataans...99Data entered by customer orcashier.

P-48-8-2 TYPE OF CUSTOMER DATA

1 - Vehicle ID
3 - Driver ID
4 - Mileage
 

P-48-9 TRACK II OF VEHICLE CARD

Used to specify the second card in a transaction if a special card is needed in addition to the payment card to link a transaction to a loyalty account.

P-48-14 PIN ENCRYPTION METHODOLOGY

See security documentation section for details.

P-48-37 VEHICLE IDENTIFICATION ENTRY MODE
Only present when a vehicle number is available (P48-8). Defines how the vehicle number was entered:

0 - Manual entry
1- On the Card
2 - Automatic License Plate Recognition

P-48-38 PUMP LINKED INDICATOR

Indicating whether the fuel pump reading is is linked to the payment terminal:
0 – Unspecified
1 – Pump-linked
2 – Pump not linked
 

P-48-39 DELIVERY NOTE NUMBER
Number allocated by the terminal given to the customer as printed on the ticket.

P-49 CURRENCY CODE , TRANSACTION
All transactions are in local currency, as defined during system installation. Actual value is as defined by ISO 4217.

P-52 PIN DATA

See security documentation section for details.

P-53 SECURITY RELATED CONTROL INFORMATION

See security documentation section for details.

P-56 ORIGINAL DATA ELEMENTS

Data elements of original transaction which contains the original “message identifier”, original “STAN” and original “date and time – local transaction”. This must be present if the message is preceded by an 1100 Authorisation Request, it can be omitted if the message is as a result of a store and forward transaction.
In Payment advice : Link to previous Authorization dialog
In reversal advice   : Link to previous Authorization request or previous Payment request being reversed.
 

P-61 PIN KSN

This optional field contains a KSN for the PinBlock. To be used instead of the PinKey indicated in P53. See security documentation section for more details.

NumberNameFormatAttributeDescription
61 n3LLLVAR length field. Sets the length of P-61 data
62-1PIN KSNans20PIN KSN for the PinBlock. Formated as a Hex encoded string

P-62 PRODUCT SETS AND MESSAGE DATA

This field contains allowed product sets and message data.

NumberNameFormatAttributeDescription
62 n3LLLVAR length field. Sets the length of P-62 data
62-1Allowed productsans...99LLVAR field, contains the products that are allowed
62-2Device textn1For what device 62-3 is to be sent to
62-3Message textans...999LLLVAR field. Display text

All subfields must be present when bit 62 is set. Field 62 shall not be sent if none of the three subfields need to be sent. If one of the subfields needs to be sent, all three subfields shall be sent.
 

P-63 PRODUCT DATA

This data element provides the detailed information on the products purchased or selected by the customer. The first two fields (63-1, 63-2) appear once per transaction.  The next seven fields can be repeated up to 18 times.

Each product is represented by seven fields: Product Code, Unit of Measure, Quantity, Unit Price, Amount, Tax code and Additional product code. The variable length fields and the succeeding entry are separated by a back-slash (\).
Unit price and amount may be negative or positive, but the sum of the amounts in the product data must equal the transaction amount.
The values of Quantity and Unit price may have a value that includes both integer and fractional values. The format of these fields consists of a single digit, which specifies the number of fractional digits following the integer, followed by the numeric value.
The value must be numeric. The number of fractional digits has a maximum of 4. The Amount field may have fractional digits. The number of fractional digits is specified by the currency code.

The list of sales items can contain a mixture of normal sales items and refund items. These are included in the online Host message as follows:

NumberFormatFieldDescription
63n 3Product dataLLLVAR length field. Sets the length of P-63 data
63-1a 1Service level

S - Self-serve
F - Full serve
Space - Information not available

63-2n 2Number of productsCount of products (sale item) reported for this transaction.

Each Sales item consists of the following components:

NumberFormatFieldDescription
63-3n 3 Product code3-digit product code that defines the type of product sold
63-4a 1 Unit of measureIndicates the meaning of the Quantity field. ‘U’  Sold per Unit
‘O’ Unit of Measurement undefined ‘L’  Sold per Litre.
63-5n 9QuantityNumber of product units
  Separator‘\’ To separate Quantity from Unit-Price
63-6sn 9Unit priceStarts with a Minus sign when Unit price is negative. First digit is exponent. Typically 3 for fuels, and 2 for shop articles. Remaining digits are actual unit price
  Separator‘\’ To separate Unit price from Amount
63-7sn 12AmountStarts with a minus sign in case Item amount is negative. 2 decimals are always implied.
  Separator‘\’ To separate the Amount from the Vat Code
63-8an 1Tax code1 digit VAT code
63-9n 14Additional Product codeUp to 14 digits article number as known in the POS
  Terminator ‘\’ To mark the end of this sales item

P-64 MAC

See security documentation for details.

P-127 Encrypted data

This field contains the encrypted track2 data. See security documentation section for details on how to generate this field.

P-128 MAC

This field is used for MAC if P-127 is present. See security documentation for details.

Tags:
Created by Helge Dahl on 2020/04/02 10:11