Preformatted Receipts

Starting from PayServer version 1.28, you have access to preformatted receipts. These receipts can be printed right away without any necessity for further formatting. The preformatted receipts are flexible to be adjusted according to your printer's character limit for each line.
Setting Preformatted Receipts Line Limit
In order to define the maximum characters of each line of preformatted receipts, add the following setting to your PayServer
config.yaml
file:
settings: receipt: max_line_length: 40 # optional; will default to some predefined value if omitted
Please note that
40
is just an example value. The actual value depends on your printer's limit that it can print on its paper. Longer lines will be wrapped to their respective next lines in the returned output.
Retrieving Preformatted Receipts
Once you have defined the maximum line length of your preformatted receipts, you can simply print them for both customer receipt and merchant receipt. To retrieve the lines, there is an element called
lines
whose data type is an array of strings at the top level of both
CustomerReceipt
and
MerchantReceipt
.
"customerReceipt": { ..., "lines": [ "Payworks", "Dingolfingerstr.", "11111", "Munich", "Germany", "123", "", "Customer Receipt Payment", "", "€1.00", "", "Scheme Visa", "Account **** **** **** 1234", "AID A0000000031010", "Entry Mode Chip", "TC B0F614B9BD0D43D1", "", " Please retain receipt! ", "", "10/21/2020 3:58:31 PM", "", "Transaction CI_fhS", "Authorization AI_Ffd/II_woR", "Merchant ID", " a125ae92-3bad-43d0-a366-3ccb004f0214", "Terminal ID BAD12345", "", "________________________________________", "" ] }, "merchantReceipt": { ..., "lines": [ "Payworks", "Dingolfingerstr.", "11111", "Munich", "Germany", "123", "", "Merchant Receipt Payment", "", "€1.00", "", "Scheme Visa", "Account **** **** **** 1234", "AID A0000000031010", "Entry Mode Chip", "TC B0F614B9BD0D43D1", "", " Please retain receipt! ", "", "10/21/2020 3:58:31 PM", "", "Transaction CI_fhS", "Authorization AI_Ffd/II_woR", "Merchant ID", " a125ae92-3bad-43d0-a366-3ccb004f0214", "Terminal ID BAD12345", "", "________________________________________", "" ] }