Status Packet

Status package is either configured with HTTP or TCP/IP communication.

1. Status Packet via TCP/IP

Via TCP/IP, a socket is secured to transfer all message packages between merchant and ANYpay POS. In this scenario, the status packet is also sharing the same socket with the main transaction, see a code sample of StatusPackage for TCP/IP as below.

PosClientService _posClientService = new PosTcpClientService("127.0.0.1", 5002,
 statusPacket => {
  Console.WriteLine("** StatusPacket ** ");
  Console.WriteLine(
   ((int) statusPacket.CustomerInteraction) == 0 ?
   statusPacket.DeviceIsDisplaying.ToString() :
   statusPacket.CustomerInteraction.ToString()
  );
  Console.WriteLine("*****************");

  return true;
 });

The following table contains StatusPackage objects and their detailed definitions.

StatusPackage Response

Field Name Type (C#) Mandatory Description
DeviceIsDisplaying Enum Yes This is the human readable message which reflect the status of Ped Entry Device during the time transaction is processed
CustomerInteraction  Enum Yes This is the human readable message which is shown on the Ped Entry Device, with the purpose of noticing the card holder to interact with the PED i.e Insert card, Enter PIN, etc

2. Status Packet via HTTP

In order to receive status packets via HTTP, a listener must be configured in the web portal under workstation settings.

916

The merchant listener URL should be implemented with the backend logic as the code sample below

var statusPacketContent =
 @ "<?xml version='1.0' encoding='utf-16'?> <
 StatusUpdate
xmlns: xsi = 'http://www.w3.org/2001/XMLSchema-instance'
xmlns: xsd = 'http://www.w3.org/2001/XMLSchema'
xmlns = 'http://servebase.com/2009/06/pedframework' >
 <
 DeviceIsDisplaying > InsertOrSwipeCard < /DeviceIsDisplaying> <
 CustomerInteraction > None < /CustomerInteraction> <
 TransactionReference > StatusPacket < /TransactionReference> <
 Workstation > 002 < /Workstation> <
 /StatusUpdate>";

StatusUpdate statusPacket = statusPacketContent.ToStatusPacket();

Console.WriteLine(statusPacket.TransactionReference);
Console.WriteLine(statusPacket.Workstation);
Console.WriteLine(statusPacket.CustomerInteraction);
Console.WriteLine(statusPacket.DeviceIsDisplaying);

The following table contains StatusPackage objects and their detailed definitions.

StatusPackage Response

Field Name Type (C#) Mandatory Description
DeviceIsDisplaying Enum Yes This is the human readable message which reflect the status of Ped Entry Device during the time transaction is processed
CustomerInteraction  Enum Yes This is the human readable message which is shown on the Ped Entry Device, with the purpose of noticing the card holder to interact with the PED i.e Insert card, Enter PIN, etc
TransactionReference string Yes This is the merchant's own unique reference for the transaction
Workstation string Yes This is the workstation number, a unique workstation ID allocated to a workstation when the service is set up