question

Suraj Dubey avatar image
Suraj Dubey asked Jeffrey Blattman edited

How to show qrcode of order_id in recipt

I have order id and now i have to create a qrcode from that order id and show it at the end of customer receipt. I tried enabling smart reciept where i have given some test text, but it was not there bill. I have a dialog box which opens when payment successfull intent is fired. Need help.
Print
3 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.

Suraj Dubey avatar image Suraj Dubey commented ·

@Lee Tickett Please help

0 Likes 0 ·
Lee Tickett avatar image Lee Tickett commented ·

Is this for an order receipt or payment receipt?

0 Likes 0 ·
Suraj Dubey avatar image Suraj Dubey Lee Tickett commented ·

@Lee Tickett payment receipt. When we click on the option print receipt. I want the qrcode of that order id on that receipt

0 Likes 0 ·
Lee Tickett avatar image
Lee Tickett answered Suraj Dubey commented
We use the zxing library to generate barcodes and qrcodes
Use https://clover.github.io/clover-android-sdk/com/clover/sdk/v1/printer/job/ImagePrintJob.html to print- something like;
PrintJob ipj = new ImagePrintJob.Builder().bitmap(bmp).maxWidth().build();
ipj.print(context, CloverAccount.getAccount(context));
2 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.

Suraj Dubey avatar image Suraj Dubey commented ·

@Lee Tickett I want this qrcode to be printed at the bottom of print receipt.

0 Likes 0 ·
Suraj Dubey avatar image Suraj Dubey commented ·

Also if it is possible with smart receipt , how i can create a qrcode for that order .So that if someone scans it , it should redirect to that order.

0 Likes 0 ·
Jeffrey Blattman avatar image
Jeffrey Blattman answered Jeffrey Blattman edited
See https://github.com/clover/clover-android-sdk/blob/master/clover-android-sdk-examples/src/main/java/com/clover/android/sdk/examples/ReceiptRegistrationTestActivity.java and https://github.com/clover/clover-android-sdk/blob/master/clover-android-sdk-examples/src/main/java/com/clover/android/sdk/examples/ReceiptRegistrationTestProvider.java in the SDK for an example of how to do this.

In brief, you register a content URI with the system, and implement a content provider to back the URI. At print time the system calls your content provider to obtain either an image or text to add to the receipt.
2 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.

Suraj Dubey avatar image Suraj Dubey commented ·

@Jeffrey Blattman The scenario is like When the intent is fired from clover device after payment is done , a popup is opened with yes/no button to get some info. Now after pressing button of print receipt from clover mini , I want a qrcode printed on the payment receipt at the bottom with some text. The qrcode will be created with same order_id which i have .

Now you have given these two files. I dont have to show any other ui . I just have to print the qrcode on the payment receipt bottom. Thanks. Please suggest

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

I suggest looking at the samples I provided. AFAICT it's exactly what you want.

We do not have any "print barcode with order URL" feature. If you want a barcode printed at the bottom of the receipt, you have to generate and provide the barcode image yourself with the mechanism I linked above.

0 Likes 0 ·

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