Links that behave like production
A simulated host answers what it’s sent. A production link does more: it wants the other side to sign on before traffic flows, it sends echoes to check the other side is alive, it cuts over at the end of the business day, and it answers a repeated request the same way twice. This walkthrough sets a host up to do that, and tests a switch against it.
1. Require sign-on
Section titled “1. Require sign-on”In the host form’s Link card, tick Require sign-on. Each connection now starts signed off: authorizations, financial requests and reversals on it are declined with 91 until it sends an 0800 with field 70 = 001 and the host answers 00. An 0800 with 002 signs it off again. Sign-on is per connection, as on a real link, and either side can send it.
2. Duplicates and repeats
Section titled “2. Duplicates and repeats”Networks deliver some messages twice, and acquirers repeat what went unanswered (0101, 0121, 0401, 0421). Under Duplicate requests, choose what the host does with a request it has seen within the window (the same message class, STAN, transmission date and time, and acquirer):
- Answer as the first time: the same response, and nothing else happens.
- Decline with 94: the network’s code for a duplicate transmission.
Either way, a repeat gets the first answer: that’s what a repeat is for. Its response MTI drops the repeat flag (0121 is answered 0130, 0421 with 0430), the common convention; Answer repeats keeps it (0131, 0431) for systems that expect that. A stateful issuer host (see the stateful issuer walkthrough) also keeps a journal of what it answered, so money never moves twice.
3. Messages the host sends
Section titled “3. Messages the host sends”Under Messages the host sends, add what the host should send to the systems connected to it:
| Kind | What it sends |
|---|---|
| Echo | 0800, field 70 = 301 |
| Sign-on, sign-off | 0800, field 70 = 001 or 002 |
| Cutover | 0800, field 70 = 201; add the new business date with Fields, for example 15=1002 |
| Custom | the MTI and fields you give |
Give a message a schedule (every N seconds) or leave it empty to send it only on demand. The host sends it on every open connection, gives each its own STAN, and waits for the answers; each exchange is in the host’s activity and the message log, marked as sent by the host. The host page’s Send to connected systems card sends any of them now and shows what each connection answered.
The table shows the built-in layouts in ISO 8583:1987. In 1993 and 2003 hosts they follow ISO 8583’s later editions: an 1804 (2804 in 2003) with its function code in field 24, which is 831 for an echo test, 801 for sign-on, 802 for sign-off, 821 for cutover and 815 to deliver a key. A host that requires sign-on takes a sign-on the same way, by field 70 in 1987 and by field 24 later. The packs reference lists each code with its public source.
Sign-on, sign-off and echo test in 1987 are as Australia’s AS 2805 interchange publishes them. Cutover (201) and key change (161) are the Platform’s own: no public source we found states them, and networks differ (where a cutover’s date goes, how a key change carries its key). For a network’s own layout, give the MTI and fields; they’re placed by the host’s dialect.
4. Exchange keys
Section titled “4. Exchange keys”A host that checks PINs (see the stateful issuer walkthrough) can change the zone PIN key they arrive under, as networks do. On the HSM page, add the ZMK you share with the switch. Add a message of kind Key change and name that zone master key.
When it’s sent (on its schedule, from the host page, or from a scenario), the host has the HSM generate a new zone PIN key (A0, the way an issuer’s host application does) and sends it under the zone master key, with its check value, in field 48. That layout is ours; put the key where your network wants it with Fields, using {{key}} and {{check_value}}, for example 120={{key}}, 48={{check_value}}.
Once every connection that answered took the key (00), the host keeps it in the HSM as Host N working ZPK and checks PINs under it from then on; scenario runs send their PINs under it too. If anything answered otherwise, nothing changes. Each exchange is in the host’s activity, and the kept key is on the HSM page with its check value.
5. Test a switch that has to answer
Section titled “5. Test a switch that has to answer”A scenario can have the host send something and check what the switch does with it:
name: Echo from the hosttarget: {simulated_host: Switch link}steps: - name: Ask the host for an echo host: {send: echo} - name: The echo arrives, and is answered receive: {mti: "0800", fields: {70: "301"}, timeout_ms: 3000} expect: {present: [7, 11]} reply: {}To test what a system does with repeats, have a step repeat its message while no answer comes, as an acquirer or network does (store-and-forward):
- name: An advice, repeated until the issuer answers send: {sample: auth, mti: "0120", amount: 1000, repeat_until_answered: {every_ms: 2000, times: 5}} expect: {mti: "0130", fields: {39: "00"}}It sends the advice, and when nothing answers within every_ms sends it again as its repeat (0121), with the same STAN and fields, up to times times. The run shows how many attempts it took. Against an issuer, check that the advice was applied once, however many times it arrived.
A step does one thing: send a request and check its response, receive a message the host sends and check it, or have the host send one now with host. A receive step waits for a message matching its MTI and fields; others that arrive first (a scheduled echo, say) wait for a later receive. reply answers what was received: the response MTI and fields 7, 11 and 70 come from it, 39 is 00 unless you set it, and you can add fields and sub-element paths.
6. File updates and administrative messages
Section titled “6. File updates and administrative messages”File updates (03xx, such as 0302 to change a card on an issuer’s file) and administrative messages (06xx: 0600 requests and 0620 advices) are answered by a host’s rules, like any other message: the response MTI is the request’s (0312, 0610, 0630), with 00 unless a rule says otherwise. Networks carry the file update code in field 91 and the file’s name in field 101, with codes and file names of their own, so the Platform doesn’t read them for you: a rule can match them, as it can any field, and answer the way your network does.
A host that answers 25 (record not found) for a card its file doesn’t have:
rules: - name: Not on file match: {mti: ["0302"], pan_prefix: ["4012888888881881"]} response_code: "25"Match fields: {91: ...} to answer by file update code, or fields: {101: ...} by file. If your network expects the file name or update code back in the answer, add them with set_fields. A stateful issuer leaves these messages to the host’s rules too: its cards are changed from the host page, the API or a scenario’s state, not by file updates.
A scenario sends them as it sends anything, with the MTI and fields it needs:
- name: Update a card on the file send: mti: "0302" fields: {2: "4111111111111111", 7: "1003101500", 11: "000301", 91: "2", 101: "CARDFILE"} expect: {mti: "0312", fields: {39: "00"}}
- name: An administrative advice send: {mti: "0620", fields: {7: "1003101503", 11: "000602", 48: "Maintenance window tonight"}} expect: {mti: "0630", fields: {39: "00"}}The example scenario examples/scenarios/file-updates.yaml runs both, against a host named “Card file” with the rule above.