question

Rohit Bhardwaj avatar image
Rohit Bhardwaj asked Frank Faustino Deactivated edited

How to print lineItem userData in order receipt?

Hi,

Since lineItem note has a limitation of 255 characters, I'm using userData object of lineItem to save some of the required data which is highly important for my app. When I see an order on Orders app, I can only see the data of note object displayed also the order receipt will only print the note. Can you please advice on how to display the userData value on the order receipt ?
OrdersPrintLineItems
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.

Frank Faustino avatar image Frank Faustino ♦♦ commented ·

Hey, @Rohit Bhardwaj. Are you using the Android SDK or REST API to fetch the order data and interact with the printer?

0 Likes 0 ·
Rohit Bhardwaj avatar image Rohit Bhardwaj Frank Faustino ♦♦ commented ·

Hey @Frank Faustino, I use the Android SDK and it's orderConnector to create the order and redirect it to the Register app using ACTION_START_REGISER Intent. I wanted to know if there is a way we could use userData json object to print it in the Order and Payment Receipts?

0 Likes 0 ·
Frank Faustino avatar image Frank Faustino ♦♦ Rohit Bhardwaj commented ·

You can add arbitrary text or images to the bottom of receipts using the receipt registration mechanism: https://github.com/clover/android-examples/tree/master/receipteditexample

Give it a try and let me know if that works.

An alternative would be to redirect the user back to your app after payment from the Register app using ACTION_PAYMENT_PROCESSED Intent and run your printing logic there.

0 Likes 0 ·
Rohit Bhardwaj avatar image Rohit Bhardwaj Frank Faustino ♦♦ commented ·

I know how to print custom a message using the below line, and we have been using this to print the Order receipts so far, but when the app is redirected to Register app for Payment the whole control for printing is on the clover and not on us. Please advice if there is a way out.
TextPrintJob.Builder().text(message).build().print(context, mAccount)

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