question

masfugo avatar image
masfugo asked Dan commented

Where to add custom line item in android?

I have browsed around in the community and documentation about how to add custom line item in the receipt, But all I can found is the piece of code of how to add them. something like

LineItem line = new LineItem();
line.setName("My Custom Line Item");
line.setPrice(Long.valueOf(200));
orderConnector.addCustomLineItem(mOrder.getId(), line, false);

But I've never found any complete source code to understand where should I put this codes. I tried to put it in AsyncTask onPostExecute and it return something like cannot execute in thread UI. And then I tried to add it on doInBackground inside the try catch but it return something like status 400 Order {some json info}

I am totally clueless right now. can someone help me? thank youuu
OrdersPrintLineItems
1 comment
10 |2000

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

Dan avatar image Dan ♦ commented ·

addCustomLineItem uses IPC, binding to engine (com.clover.engine) in order to add the line item, and engine does some checking before it adds it. Please provide the error message.

A minimal, complete, verifiable example (https://community.clover.com/page/asking-questions) including the order creation would be ideal.

0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

Welcome to the
Clover Developer Community