My customer facing POS needs to cancel payments on a Flex 2 when a user presses a cancel button or due to a timeout. This may happen at any point after the sale is initiated.
To accomplish this, I'm attempting to call CloverEventConnector.VoidPayment as follows:
var voidPaymentRequest = new VoidPaymentRequest(); voidPaymentRequest.PaymentId = this.TransactionId; voidPaymentRequest.VoidReason = VoidPaymentRequest.USER_CANCEL; clover.VoidPayment(voidPaymentRequest);
This fails with an InvalidStateTransition message, for example:
InvalidStateTransition Could not transition to Void Payment From BUSY::STARTING_PAYMENT_FLOW to Void Payment.
InvalidStateTransition Could not transition to Void Payment From WAITING_FOR_CUSTOMER::RECEIPT_SCREEN to Void Payment
How can the POS cancel these pending sales?