On Demand Print Receipt

This method controls the content printed on the receipt.

error_outline
note

Currently not supported in Canada.

Code Samples

CWS

Request

method
string | required
startPrintReceiptOnPrinter
 
requestId
string | required
Transaction Request ID
 
targetType
string | required
printer
 
parameters
JSONObject | required
All relevant parameters to receipt content.
 
receipt
JSONObject | required
Receipt Parameters
Object containing the text, control characters or BASE64-encoded JPEG image to print on the receipt.
formattedText
TBD | required
Formatted Text
The text, control characters or BASE64-encoded JPEG image to print on the receipt.

Response

requestId
string
Transaction Request ID
As specified in the request.
statusDetails
string
Request Status
 
data
JSONObject
Object holding various responses.
 
printRequest
JSONObject
Object holding print receipt responses.
 
printRequestId
TBD
Print Request ID
Unique transaction request identifier.
completed
boolean
Request Result
Print request result.

Example

Request
{
  "method" : "startPrintReceiptOnPrinter",
  "requestId" : "1323697689",
  "targetType" : "printer",
  "version" : "1.0",
  "parameters" : {
    "receipt" : {
      "formattedText" : "~0A~0i/9j/4AAQSkZJRgABAQEAYABgAAD/4QNSRXhpZgAATU0AKgAAAAgABVEAAAQAAAABAAAAAFEBAAMAAAABAAEAAFECAAEAAAMAAAAASlEDAAEAAAABAAAAAFEEAAEAAAAB/AAAAAAAAAAAAAAAADMAAGYAAJkAAMwAAP8AKwAAKzMAK2YAK5kAK8wAK/8AVQAAVTMAVWYAVZkAVcwAVf8AgAAAgDMAgGYAgJkAgMwAgP8AqgAAqjMAqmYAqpkAqswAqv8A1QAA1TMA1WYA1ZkA1cwA1f8A/wAA/zMA/2YA/5kA/8wA//8zAAAzADMzAGYzAJkzAMwzAP8zKwAzKzMzK2YzK5kzK8wzK/8zVQAzVTMzVWYzVZkzVcwzVf8zgAAzgDMzgGYzgJkzgMwzgP8zqgAzqjMzqmYzqpkzqswzqv8z1QAz1TMz1WYz1Zkz1cwz1f8z/wAz/zMz/2Yz/5kz/8wz//9mAABmADNmAGZmAJlmAMxmAP9mKwBmKzNmK2ZmK5lmK8xmK/9mVQBmVTNmVWZmVZlmVcxmVf9mgABmgDNmgGZmgJlm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i3jlWYwuN0cjLyu5TwwDYYA/xKp7VdooA5n/hT3hz7MsP9mx+TG7skYkcIivCITEFBwIfLVFEQ+QeWh25UEXpvAtjeRSLcte3XmW81oWku5c+TLsDJww7RoA33hgnO5nLbFFFg7eRgv8ADbSJo4o5LeSS3ttot4DMwjtlWRJQiKCMJuRfl5G0BMbPlpbn4eafcTxuGu49lolk+2Ys08SEmMO7ZclGJYMGBJJyTnFbtFPma2CxzNv8JNF02W3m0+GbTrmzjgjhmglLMghieGMlX3IzCKR03OpYqRk/KpW1rvw70nxHctJeW3mLLPBdSxbyI5pYWVopGXpuUooJGCyqqtuUBa3KKLsfM9znz8OLPzreZbrU/tViV+xztcmRrVRG0e1Q2VYFXbJcMWO0sSyIVml+H+l3N7d3E0LSzXk1vPI5kYNm3l86EbgQSqyEsASRhiv3MKNqikLbVGCvw50+G7lkhe8t47hi88MU5VJn86Sfdn7ykSyu2UZeoByoAE+h+CrPwzdM2mtNZ28h3SWsZUwyEIEU/MCy7VVFAUqAEUYwMVr0UeYXb3PKfjZ+x94Z+M3jW18WQ6j4m8F+N7O1NhH4k8Mah9g1CS1Lb/s02VeK4h34cJNG6qwBAHOcG3/YO0fW/F2nar428c/Ej4lQ6Pcx31lpXiPU4DpcFzGQY5zbWsEEcroRlfNDhTyADzXulFPmYBRRRSAKKKKAP//Z~0i~0A~0A~0C~1EJoe's Pizza~0A~0E~0A~0LDate: 10/27/2016 7:21:07 AM~0A~0ACard Number: ************0001~0A~0A~0RSubtotal: $50.00~0A~1BTotal: $50.00~0B~0A~0A~0C-------------------------------~0A~0A~0A-------------------------------~0A~0A~0LPete was here~0A",
      "base64EncodedImage" : ""
    }
  }
}

Later...

{
  "method" : "getPrintReceiptStatusOnPrinter",
  "requestId" : "1323697690",
  "targetType" : "printer",
  "version" : "1.0",
  "parameters" : {
    "printRequestId" : "1323697689"
  }
}
Response
{
  "requestId" : "1323697689",
  "statusDetails" : "REQUEST_ACCEPTED",
  "data" : {
    "printRequest" : {
      "printRequestId" : "1323697689",
      "eventQueue" : [ {
        "timeStamp" : "1477578070098",
        "statusDetails" : "STARTING"
      } ],
      "completed" : false
    }
  }
}

Later...

{
  "requestId" : "1323697690",
  "statusDetails" : "REQUEST_ACCEPTED",
  "data" : {
    "printRequest" : {
      "printRequestId" : "1323697689",
      "eventQueue" : [ {
        "timeStamp" : "1477578070098",
        "statusDetails" : "STARTING"
      }, {
        "timeStamp" : "1477578073155",
        "statusDetails" : "COMPLETED"
      } ],
      "completed" : true
    }
  }
}

Java

Find Online Printer

    ECLPrinterInterface printerInterface;

    void findPrinter()
    {
        ECLAccountInterface account = myAccount;;

        final ECLDevicesInterface<ECLPrinterInterface> printers = account.getPrinters();

        ECLDevicesSearchingListener listener = new ECLDevicesSearchingListener()
        {
            @Override
            public void devicesSearchFound(String s, ECLDeviceConnectionType eclDeviceConnectionType)
            {
                ECLPrinterInterface myP = printers.setDeviceToUse(s, ECLDeviceConnectionType.enumSetForAll());
                if (myP.isPrinterOnline())
                {
                    logger.info("printers search found online " + s);
                    printerInterface = myP;
                }
            }

            @Override
            public void devicesSearchDone(List<ECLDeviceSearchResult> deviceSearchResults)
            {
                logger.info("printers search done");
            }
        };

        ECCError error = printers.findDevices(listener, ECLDeviceConnectionType.enumSetForAll(), 9);
        if (null != error)
        {
            /* handle error */
        }
    }

Create Print Text

    private class FormattedText
    {
        final static String newLine = "~0A";
        final static String redText = "~12";
        final static String base64EncodedImage = "~0i";
        final static String sigBin2 = "~0S";
        final static String center = "~0C";
        final static String right = "~0R";
        final static String left = "~0L";
        final static String bigOn = "~1B";
        final static String bigOff = "~0B";
        final static String boldOn = "~1E";
        final static String boldOff = "~0E";
        final static String formFeed = "~0F";
    }

    String createPrintText()
    {
        StringBuilder sb = new StringBuilder();
        sb.append(FormattedText.newLine);

        String myBase64;
        if (null != myBase64)               /* Do we have a base 64 encoded JPG? */
        {
            sb.append(FormattedText.base64EncodedImage);
            sb.append(myBase64);
            sb.append(FormattedText.base64EncodedImage);    /* This control is a toggle */

            sb.append(FormattedText.newLine);
            sb.append(FormattedText.newLine);
        }

        /* Now the company name, bold and centered */

        sb.append(FormattedText.center);
        sb.append(FormattedText.boldOn);
        sb.append("Desktop Sample App");
        sb.append(FormattedText.boldOff);
        sb.append(FormattedText.newLine);

        /* More simple text */

        ...

        ECLMagStripeOnlyData mySignature;

        if (null != mySignature)    /* Do we have a signature? */
        {
            sb.append(FormattedText.left);

            if (mySignature.getFormat() == ECLSignatureData.Format.SIG_BIN_2)
            {
                sb.append(FormattedText.sigBin2);
                sb.append(mySignature.getData());
                sb.append(FormattedText.sigBin2);   /* This toggles */
            }
            else
            {
                sb.append(FormattedText.base64EncodedImage);
                sb.append(mySignature.getData());
                sb.append(FormattedText.base64EncodedImage);    /* Toggle */
            }
            sb.append(FormattedText.newLine);

            sb.append(FormattedText.newLine);
        }
        sb.append(FormattedText.left);
        sb.append("Thank you.");
        sb.append(FormattedText.newLine);

        return sb.toString();
    }

Print

    void printReceipt(ECLPrinterInterface printerIF, String text)
    {

        final ECLPrinterListener printerListener = new ECLPrinterListener()
        {
            @Override
            public void printDidSucceed(ECLPrinterInterface eclPrinterInterface)
            {
                logger.info("print succeeded!");
            }

            @Override
            public void printDidFail(ECLPrinterInterface eclPrinterInterface, ECCError eccError)
            {
                String errorName = ((ECLCommerceError)eccError).getCode().name();
                logger.info("receipt print failed! error: " + errorName);
            }
        };

        printerIF.printFormattedText(text, printerListener);
    }

C#

String text = createReceiptText();

* Asynchronous */

     m_CWS.StartPrintReceipt(text, null, MyNotifyCWSEvent, MyPrintReceiptComplete);

/* Synchronous */

      PrintReceiptResults rr = m_CWS.PrintReceipt(text, null, null);
      MyPrintReceiptComplete(rr);

/* Nothing interesting */

        public void MyPrintReceiptComplete(PrintReceiptResults rr)
        {