Without QR code
The next examples show what virtual receipts look like on landscape (wide) and portrait (narrow) terminal displays. The receipt lines are scrollable.
With QR code
It is also possible to add a QR code. A terminal with a landscape display shows the QR code next to the receipt lines.
A terminal with a portrait display shows two screens. First a screen with the QR code and a button to proceed, and then a screen with the receipt lines.
Receipt XML file
To show a virtual receipt on the terminal display, you need to gather all content in an XML file, convert this file to a Base64 string, and pass that string in a display request. The XML file can contain:<screen name>: the XSLT to use. This determines whether a QR code is added to the virtual receipt.<image>: the image to show on the left part of the screen. This is only supported on SFO1 payment terminals. The image must be converted to a Base64-encoded string.<qrcodeblock>: a QR code with a header and footer. When used with a<screen name>that doesn’t support showing a QR code, the<qrcodeblock>is ignored.<list-header>: the header line of the virtual receipt.<lines>: contains line items that represent the goods that the shopper is purchasing. Each line item can have acount,description, andamount. Theamountcan havecurrencyandvalue. On SFO1 terminals, each line can also have aniconand asubtitle.<subtotal>: the amount due before discounts and taxes.<tax>: total discounts, amount and type of taxes, total tax amount.<total>: final amount due.
<screen name> that is compatible with the terminal and the result you want to achieve:
Example XML file
Make a display request for a virtual receipt
-
Create the virtual receipt:
-
Based on our example XML file, populate an XML file with line items and total amounts from your POS app. Make sure that you use the correct screen name:
<screen name="virtual-receipt.xslt">: shows a receipt without QR code where the receipt has a ‘sticky’ header which remains visible when scrolling down the receipt lines. For use on portrait terminals: AMS1, e280, P400 Plus, S1E, S1F2, V400c Plus, and V400m.<screen name="virtual-receipt-with-qr-code.xslt">: shows a receipt with a QR code. For use on any terminal model that supports virtual receipts.<screen name="virtual_receipt01.xslt">: shows a receipt without QR code. For use on the M400.<screen name="virtual_receipt02.xslt">: shows a receipt without QR code but with a ‘sticky’ header. For use on the M400.<screen name="virtual-receipt01.xslt">: shows a receipt without QR code, a ‘sticky’ footer, and auto-scroll to the bottom. For use on the AMS1, S1E, S1F2, SFO1, V400M and P400.<screen name="virtual_receipt03.xslt">: shows a receipt without QR code, a ‘sticky’ footer, and auto-scroll to the bottom. For use on the M400.
- Convert the XML content to a Base64 string.
-
Based on our example XML file, populate an XML file with line items and total amounts from your POS app. Make sure that you use the correct screen name:
-
Make a Terminal API display request, specifying:
-
The standard
SaleToPOIRequest.MessageHeaderobject, withMessageClassset to Device andMessageCategoryset to Display.
JSON
Java
-
The standard
-
In the display response, check the OutputResult.
If the request is successful, this includesResponse.Result: Success. Display responseIf the request is not successful, theDisplayResponse.OutputResultincludes:Response.Result: Failure.AdditionalResponseandErrorCondition: more information about why the request failed.
The next example shows the response after sending the display request to an incompatible terminal. Response for a failed display request
XML validation
When we receive your display request for a virtual receipt, we check whether we can parse the XML content. We can also check whether the XML content matches the XML Schema Definition (XSD). We only do this XSD check if it is enabled for your account.-
Parsing
We always check whether we can parse the XML content of your request. For example, if the XML contains a syntax error like a missing caret>, we cannot parse the XML. You receive a failure response with XHTML data could not be parsed. XHTML data could not be parsed -
XSD
If we can parse the XML content and XSD checking is enabled, we validate the XML against the XSD. To use this validation, ask our Support Team to enable the virtual receipt XSD check. For example, if you add an element that is not in the XSD or if you omit a required element, the XML doesn’t match the XSD. You receive a failure response with XSD validation failed. XSD validation failedThe details of any XSD errors are in the terminal log.
