question

Sukhbir Singh avatar image
Sukhbir Singh asked Jeffrey Blattman answered

Need to print the receipt (merchant copy and customer copy both) on a single click of print button

Hi @


I am using Clover android SDK. I want to implement the functionality to print the receipt (merchant copy and customer copy both) on the click of the print button. We are using the following code to print the receipt:


For Card payment:

printJob = new StaticPaymentPrintJob.Builder().paymentId(mPayment.getId()).order(mOrder).build

printJob.print(mApplicationContext, account);


For Cash payment:

printJob = new StaticPaymentPrintJob.Builder().order(mOrder).build();

printJob.print(mApplicationContext, account);


When we clicked on the "Print" button, only one receipt got printed. While we have required to print two copies (Merchant copy and customer copy) on a single click. Please suggest a way to achieve it. Is there any configuration from the clover side to achieve that?


Thanks.

PaymentsClover Android SDKClover MiniClover FlexPrint
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.

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

Which doesn't print? Do they both print okay individually? E..g., if you comment the code to print A, print, then comment the code to print B, and print, do they both print okay?

There's no trick. Each print job is independent.

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

Actually I want that I use printJob.print(context, account); only one time and the printer should print the two copies of the receipt in which one copy will have the message "Merchant copy" below the bar code at the bottom of the receipt. Is it possible?

0 Likes 0 ·

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered
Actually I want that I use printJob.print(context, account); only one time and the printer should print the two copies of the receipt in which one copy will have the message "Merchant copy" below the bar code at the bottom of the receipt. Is it possible?

There's one case where this happens... if there's a payment, and the merchant is configured to accept signatures on paper (not typical), AND you do not set either FLAG_CUSTOMER or FLAG_MERCHANT).

If you want this behavior, I'd just send two print jobs. Not clear to me why you are trying to avoid that.

10 |2000

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