question

georgi avatar image
georgi asked ivetageorgieva commented

Error while registering to print info on receipt

I am trying to print some dynamic text on the receipt of the merchant. I am using the SDK ReceiptRegistrationConnector class and I register the Uri for my ContentProvider class. The problem is that I receive the following error:

ResultStatus{statusCode=SERVICE_ERROR, statusMessage=null}

Here is the code I user to register:

```

public void registerReceiptPrint() {

  if (CloverAccount.getAccount(context) == null) {
        throw new Exception("User account is null!");
    }

    ReceiptRegistrationConnector connector = new ReceiptRegistrationConnector(context,                  CloverAccount.getAccount(context), null);
    new AsyncTask<Void, Void, Void>() {

        @Override
        protected Void doInBackground(Void... params) {
            try {
                connector.connect();
                if(connector.isConnected()) {
                    connector.register(ReceiptProvider.AUTHORITY_URI);
                }
            } catch (RemoteException | ClientException | ServiceException | BindingException e) {
                e.printStackTrace();
                Timber.e(e, "Error registering authority!");
            }
            connector.disconnect();
            return null;
        }
    }.execute();
}

```

I tried to run the clover example with the register option, but the same error occurs. Basically it doesn't work as explained here

Any ideas why is that?

4 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

Are you including the Clover account when you bind to the service? Are you sure it's not null?

0 Likes 0 ·
georgi avatar image georgi commented ·

Hi Jeff, yes, I debugged it and it is not null. The strange thing is that even the clover-example app is not working. It was working 2 days ago. Could there be a problem with the clover api and that is why I get the 500 error?

EDIT

The error occured because the ReceiptProvider was already registered. Now I need to figure out how to get the ContentProvider to be called.

EDIT 2

Hey Jeff, I saw from the answer in the link that WEB receipts won't show the text from the ContentProvider. So how can I test if the text is shown on a receipt?

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

You need a real printer. If you have a devkit Mini you can use it's printer. If you are using an emulator then you need to purchase a Star printer. You can pick up a TSP100. We don't officially support that for merchants but we do include drivers for it.

As a side note, I created an internal issue to create a dummy print driver that can print bitmaps to the device's file system. I don't have an ETA however.

0 Likes 0 ·
ivetageorgieva avatar image ivetageorgieva commented ·

Hi Jeff,

What is the status of the internal issue for the dummy print driver? We really need that to test the receipt printing, because unfortunately we are not able to purchase a Star printer.

Thank you for your help.

Best Regards, Iveta

0 Likes 0 ·

0 Answers

Welcome to the
Clover Developer Community