question

steve-egan avatar image
steve-egan asked Danielle Cox commented

Determe when an order is complete and paid for / hide void transaction button

Is it possible to hide the void transaction button on the Register payments screen? I see there is an intent - EXTRASHOWVOID_BUTTON which determines whether or not to show the Void Transaction button. I tried starting the pay activity and passing in this intent extra but the void button still appears.

The reason I'm trying to hide it is because I need to send a request to my server when an order is completed and I'm having difficulty determining exactly when an order is completed and paid for. The Android sdk only sets the status of an order to 'open' or 'locked' and the 'paid' status is not used.

I'm listening for ACTIONPAYMENTPROCESSED broadcasts which tell me when a payment has been attached to the order (OnOrderUpdateListener2.onPaymentProcessed() gives me this information also). At this point if the user presses the 'Done' button the Intents.ACTIONV1PAYBUILDHIDE broadcast is fired and this would be a good place to send the request to my server as I can check what payments have been made and as Mike suggested in devask[dot]clover[dot]com/question/2305 use OrderCalc.getTotal() to get the lineitem total. However if the user did not press the 'Done' button and instead pressed the 'Home' button the Intents.ACTIONV1PAYBUILDHIDE broadcast is fired also. The user can then re-open the Register app and press the void transaction button.

Would anyone have any idea of determining when an order is totally complete and the user has paid in full or failing that how to hide the void transaction button?

Thanks for your time,

Steve

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 ·

Is the problem that you have a custom tender and you aren't able to hook in to know when a payment processed with your custom tender has been voided?

0 Likes 0 ·
Danielle Cox avatar image Danielle Cox commented ·

I would like to know this answer Jeff! :-)

0 Likes 0 ·
steve-egan avatar image
steve-egan answered

Thanks for your response Jeff. I'll detail the use case to give you a better idea of the problem I'm having.

  1. User adds line items
  2. User launches my app from within the Register app.
  3. My app sends a request to my server which sends back a response to the app
  4. The app applies discounts to the total
  5. User pays for the items
  6. Once payment is received I send a request to my server to say that this transaction is over

My problem lies with the fact that after payment is received and the user is on the receipt screen the transaction can be voided. By then I've told my server that the transaction is complete. So I'm looking for a way to disable/hide the 'Void Transaction' button. I see that there is Intents.EXTRASHOWVOID_BUTTON - is there anyway I can use this ? Alternatively is there any way of knowing for sure that a transaction has completed and been paid for using the SDK i.e. the user has pressed the done button on the receipt screen?

Thanks for you help, Steve

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 answered

No you cannot hide the void button. That's vital functionality. Regardless the payment can be voided, or refunded from another app or even another device at a later point.

This seems like a hole to me. There's ACTION_REFUND that's broadcast when an order is refunded (or voided) at a later time, but there's nothing when a payment is voided right after the transaction from the receipt screen. I'll file an internal issue to track this.

Note that you can retrieve the payment at a later date using the REST API and determine if it's voided (https://www.clover.com/api_docs#!/pay...). I realize this is quite inconvenient.

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