question

kocurek avatar image
kocurek asked kocurek commented

Subscribing to Cancel Event

I would like to be notified when a customer taps the back arrow and cancels the transaction payment. It does not seem to come over with onDeviceActivityStart or onDeviceActivityEnd. If there was a way to subscribe the the sendMessage events I could use that as well.

Any tips?

10 |2000

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

blake avatar image
blake answered kocurek commented

you should be getting back an onSaleResponse or onAuthResponse with a success of false.

1 comment
10 |2000

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

kocurek avatar image kocurek commented ·

Hey Blake,

Yes, but I assumed "success": false could mean other things as well, correct? Decline, Insufficient Funds, etc...? For now I am looking for response.result == 'CANCEL' but I hate using magic strings. It would make much more sense to me to have an event fired when a user cancels.

0 Likes 0 ·
hammer avatar image
hammer answered kocurek commented

Using the saleresponse.getResult() return code is the right way to do this. Al though it is a string, it is modeled as an enumeration. You can use remotepay.ResponseCode.CANCEL for the comparison. See https://github.com/clover/remote-pay-...

1 comment
10 |2000

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

kocurek avatar image kocurek commented ·

Excellent! Exactly what I was hoping for!

0 Likes 0 ·

Welcome to the
Clover Developer Community