For verified return we are not swiping the debit card, just sending the original payment details. In that case auto refund is happening successfully on Debit cards also. is it expected behavior? As per our experience with different vendors Auto refund on Debit cards is not allowed.
There window of time that a transaction remains voidable. A sale transaction's void window lasts for 25-minutes after a payment is processed. An auth transaction will remain voidable until it is closed out. Regardless of which API is used (refundPayment/voidPayment), what actually happens to a transaction depends on whether or not the method was invoked within a transaction's void window:
refundPayment calls are actually voids at the payment gateway level if used within the void window
voidPayment calls are are actually refunds at the payment gateway level if used outside the void window
This is why you are able to "refund" the debit transaction. If refundPayment is called on a debit transaction within its void window, the Clover server will communicate to the payment gateway that the debit transaction should be voided, which is allowed. voidPayment calls outside the void window will fail because it will coerce into a call to refund the debit transaction, which is not allowed. This second coercion scenario is something that should be watched out for, as the fail will occur silently: voidPayment calls currently always return success at the sdk level.
Something else to note: This coercion to fit the void window will not affect the payment record (what shows up in Clover Transactions). These records will still correspond to whichever API called.