Before you can issue a refund, you need to issue the credits. Either a discount, or a stock item return...
Once the invoice total has reduced to less than the amount paid by a customer, then the refund form will become visible, and the amount will default to the balance owing for refund.
While this requires a 2 step process, this will be simpler for users to understand, as it conforms to a more strict business process, reducing the risk of error, as users often talk about refunds and credits like they are the same thing.
From our book keeping perspective, a credit is a reduction in the invoice total, usually a discount, but may be due to items returned.
Whereas a refund, is an amount of money returned to a customer.
Often a credit and refund are for the same amount, and need to be done at the same time...
But in other cases, a credit is given for return of one item, then consumed on the issue of a different item, and then the refund is only for the difference....
If an invoice has not been paid, then a credit is just a discount, and no refund is expected.
In all cases, the refund is only a record. The actual refund needs to be manually processed by an authorised person using whatever payment gateway. The CMS does not provide any integrated refund features, as it poses a financial risk as to who should be able to do such a thing.