question

jasonbanks avatar image
jasonbanks asked ·

Print Merchant receipt copy from Secure Payment

After calling the intent for secure payment, the end prompts customer for receipt choice (none, print, text, email). Regardless of the customers choice, is there not an option that will print a Merchant copy of the receipt? And even to force printing of a Merchant copy?
Sale
10 |2000 characters needed characters left characters exceeded

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

1 Answer

Raymond Lee avatar image
Raymond Lee answered ·
There is currently no option to automatically print the customer payment receipt twice. However, you can force print a payment receipt after your call to the Secure Pay intent finishes. Use a StaticPaymentPrintJob.Builder and pass in either a Payment object, or an Order object with a payment id. I recommend having this as a setting in your app, in case the merchant does not want a duplicate customer payment receipt to be automatically printed.

Since your call to ACTION_SECURE_PAY will return with a result data object containing a Payment object and a Payment ID, you can use either option.

In onActivityResult():
Payment Object:
Payment payment = data.getExtras().getParcelable(Intents.EXTRA_PAYMENT);

new StaticPaymentPrintJob.Builder().payment(payment).build().print(context, mAccount);

Order Object with paymentID:
Order order = mOrderConnector.getOrder(orderId);
String paymentId = data.getStringExtra(Intents.EXTRA_PAYMENT_ID);

new StaticPaymentPrintJob.Builder().paymentId(paymentId).order(order).build().print(context, mAccount);

4 comments Share
10 |2000 characters needed characters left characters exceeded

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

It appears that will work with the Payment response, but what about Manual Refund? There does not appear to be a "Payment" object available and no appropriate Static<>PrintJob. We do not use Orders explicitly, so unless Clover is automatically creating one behind the scenes, that option won't work for us.

0 Likes 0 · ·

Have you looked into using StaticCreditPrintJob? Yes, we create an order behind the scenes.

0 Likes 0 · ·
jasonbanks avatar image jasonbanks David Marginian ♦♦ ·

I have not, as I did not know about it. I searched Clover Docs for StaticCreditPrintJob, but there are no results.

0 Likes 0 · ·
Show more comments

Welcome to the
Clover Developer Community