Skip to content

Answering with a network's codes

A simulated host decides in ISO 8583’s response codes: 51 for insufficient funds, 75 for too many PIN tries. Networks number some answers differently. Elo, for example, sends 38 for too many PIN tries on a purchase, and its 04 asks the acquirer to send the transaction again, where ISO’s 04 means keep the card. A host that names a pack answers with that pack’s codes, so the system you test sees what the network would send.

In the host form, pick a Pack. The list shows the network packs whose response codes are for the host’s ISO 8583 version: Elo’s are for 1987 messages. Leave it at None for ISO 8583’s own codes. The packs reference lists every pack, what it covers and its public sources.

The change applies at once, without restarting the host or closing its connections.

The stateful issuer and the host itself still decide in ISO 8583’s terms. A host with a pack then sends the pack’s code for the same reason:

The host decides ISO 8583 sends An Elo host sends
Too many PIN tries 75 38
Insufficient funds 51 51
A currency the account isn’t in 12 05
A duplicate request 94 94

Where the pack has no code for that reason, ISO 8583’s code goes out unchanged, unless the pack uses the same number for something else. Then the pack’s generic decline goes out instead. Elo’s 12 means a problem with the card, not ISO’s “the transaction isn’t valid”, so an Elo host sends 05.

Codes you type are sent as typed: a rule’s response code, the card verification and MAC decline codes, and the data policy’s block code.

A rule’s Response code box takes a code, such as 51, or a reason, such as insufficient_funds. The box suggests every reason, with ISO 8583’s code for it. A reason is answered with the host’s pack’s code, or ISO 8583’s without a pack. So the same rule works for any network.

When the host is saved, each reason must have a code. use_chip has none in ISO 8583, so it needs a pack that has one, such as Elo (FM). pick_up has none in the Elo pack, and Elo’s 04 means something else, so an Elo host refuses it. The message says why; give the code instead.

In YAML or JSON, a rule gives reason: instead of response_code::

pack: elo@1
rules:
- name: Locked PIN
match: {amount_gt: 50000}
reason: pin_tries_exceeded

A scenario reads codes by reason too, as {{codes.<reason>}}. Against a simulated host, it gets the host’s pack. A scenario can name its own with pack:, which it needs for a system you run yourself:

name: Declines by reason
target: {simulated_host: Elo issuer}
steps:
- name: A locked PIN
send: {sample: auth, pan: "4111111111111111", amount: 60000}
expect: {fields: {39: "{{codes.pin_tries_exceeded}}"}}

Against an Elo host, the step expects 38; against a host without a pack, 75. So one scenario checks a system for any network. A reason the pack has no code for stops the run before it starts, saying why, and a misspelled reason is refused when the scenario is saved.

A pack can bring a scenario and the host it runs against. The Elo pack’s Elo declines sends an approval and each kind of decline to an Elo issuer host, and expects each answer by reason. On the pack’s page, Set up and open creates the host (on the first free port, unless you have a host of that name) and saves the scenario, then opens it to run. The public demo has both. The IFSF POS to FEP pack brings an IFSF FEP that speaks ISO 8583:1993 in IFSF’s layout and answers in IFSF’s three-digit action codes, with IFSF POS to FEP declines, IFSF forecourt flows (an outdoor sale authorized and completed, an indoor sale, a reversal, a reconciliation and an echo test, each class answered with its own code) and IFSF forecourt load, a load example in IFSF’s layout to set your site’s rate and duration on.

CI runs every pack’s scenarios against the host and, for the 1987 packs, through the reference switch in front of it, which speaks ISO 8583:1987 and must pass the codes on as the host sent them, letters included (Elo’s FM).

Each pack’s page in the console shows the reason that names each code, under its meaning. The packs reference lists every reason with ISO 8583’s code and each pack’s.