I had to work on a very similar task with Braintree, in that they also only allowed refunds after the order was settled & you could only void before that. This is not a core Magento bug as it is something specific to (some) payment gateways. Also the specific api calls differ, so it makes sense that the Magento team cannot provide a general solution.
The solution that would apply to this case is to do an AJAX call, see if the transaction is not settled and if so do a "void" call instead of a "refund". Unless the UsaEPay module vendor would do this for you, it is something that you should implement.
Luke, I've never seen an extension out there that does exactly what you need.
It's (probably) possible to implement this functionality with custom Magento code by rewriting the various quote, sales, quote item, sales item, credit memo, and credit memo, and payment module event handlers, and/or a class method rewrite or two. However, it's a rather large task and not easily answered in a single Stack Exchange question, and would require you to understand how all the above objects interact before tackling it.
This sort of programming can be more time consuming that you'd expect. Also, because it involves actual money, this needs more rigorous testing that can usually be applied in a client services environment. Also also, it gets extra tedious because each payment module type (authorizenet, paypal, stripe, etc.) seems to handle orders, credit memos, and invoices slightly differently, which means you'll often end up with subtle, hard to track down bugs. I have 4+ years Magento experience and I'd be wary of tackling this sort of problem — especially if the client needed a fixed bid.
If you're open to alternate solutions — right now it sounds like your client is handling this manually in the admin console and wants to be able to stop doing that. Instead of trying to come up with (clever and awesome) solutions using Magento's existing objects, I'd focus on automating what your client is currently doing manually. That'll likely be easier than messing around with custom account programming.
Best Answer
It seams straight forward to me. If the payment methods does not allow
caprure, refund and void
it seams normal not to have the options in the invoices.But just to make sure, if you drill down in the code starting from
Mage_Sales_Model_Order_Invoice::canVoid()
you will find this line:that will get you to
Mage_Sales_Model_Order_Payment::canVoid(Varien_Object $document)
where you will find this line:Going deeper you end up in
Mage_Payment_Model_Method_Abstract::canVoid()
that simply returns$this->_canVoid
.I didn't check, but I have a feeling that it's the same for
capture
andrefund
.