Secure Table Pay Interface (STPI) is a middleware solution that communicates between payment devices running our software (SecureTable & SecurePay) and various POS systems. This document only contains information pertaining to the integration details that must be implemented on the POS side for STPI to be able to communicate with it.
Contents
This document and the information within are the property of PayFacto Payments Inc. (βPayFactoβ) and may only be used for the purpose for which they are intended and supplied. Reproduction of this document or use of the information within, in whole or in part, is strictly prohibited without the express written consent of PayFacto. PayFacto reserves the right to revise this document and to periodically make changes to the content hereof, without obligation of PayFacto to notify any person or organization of such revision or changes.
Secure Table Pay Interface (STPI) is a middleware solution that communicates between payment devices running our software (SecureTable & SecurePay) and various POS systems. This document only contains information pertaining to the integration details that must be implemented on the POS side for STPI to be able to communicate with it.
All communications between STPI and the POS are sent over TCP/IP SSL connections.
Messages sent to and from STPI are expected to be in XML. The messages must be padded with a 5-digit header indicating the length of the XML.
All requests and responses contain the <Ident> tag with attributes id and ttype where id refers to the unique identifier for this request and ttype refers to the transaction type of this request. The responses should echo back this tag with attribute values in the request so that STPI can map the response to the particular request.
All requests and responses contain the <POSDefaultInfo> tag with attributes server, table, check, track2, res and rtext. These should be present in all requests depending on transaction type except res and rtext which should be present in all responses.
The POS server should be a multi-threaded application as more than one request can come at the same time. The server is expected to respond to them within a reasonable time frame. In a typical busy restaurant, it is possible that more than 20 terminals could be sending requests at the same time.
More sample requests & responses will be shown further in the document. The following examples are just to showcase the 5-digit length header. The POS will receive a request message with an XML root element of POSRequest. The POS is expected to respond with a response message with an XML root element of POSResponse.
Sample Request
Sample Response
These are the available transactions:
Getting tables is initiated when the server is trying to list the tables on their payment device. STPI client will communicate to the POS and request this information.
Request
The ttype for getting tables is 45.
If the request message contains the table number, the POS should return information for that table only.
If the request message contains the table number and check number, the POS should return information for that check only.
Response
The response contains a nested structure of table and check information.
Voidable Checks
When a Check xml element contains the refno attribute, this means that existing check has already been paid and that the POS has indicated that it can be voided.
Voided checks do not return a tax value, as the amt attribute is expected to be inclusive of that amount.
The check XML element has the following details
Sample Request XML
Sample Response XML
Applying the payment is initiated when the payment device is ready to apply the payment for a check.
Request
The ttype for applying payments is 46.
If edc is greater than 0, the POS should authorize with information provided and return the receipt and other miscellaneous details as outlined.
If edc is equal to 0, the POS should not return a receipt as the payment receipt is already printed on the payment device. If the receipt is returned in the response it should be formatted as shown in the example below. An Auth xml element will also be provided in the request containing the authorization code.
If refno is provided within the Payment element, that is the reference number for a voided transaction.
Sample Request XML for EDC = 1
Sample Request XML for EDC = 0
Sample Request XML for void transaction
Sample Response XML without receipt
Sample Response XML with receipt
Getting check info is initiated on the payment device to get miscellaneous details about the check and the associated table. For example, these details include items that the customers have ordered, and discounts applied to those items.
Request
The ttype for getting check info is 47.
Sample Request XML
Sample Response XML
The lock request is initiated when a check is opened on a pinpad. This should prevent the check from being opened again or pulled by the get tables until an appropriate timeout period is reached, or an unlock request is sent to the POS.
Request
The ttype for the lock request is 48
Sample POS Request
Sample POS Response
The unlock request is initiated when a check that is opened by the pinpad is no longer being used by that pinpad. This could be after the payment has been applied, or if the payment has been aborted. This should allow the check to be opened again or pulled by the get tables.
Request
The ttype for the lock request is 49
Sample POS Request
Sample POS Response