Partial refund option missing (Qty to Refund)

Here is the code that controls weather 'Qty to Refund' option is available.

public function canEditQty()
{
    if ($this->getCreditmemo()->getOrder()->getPayment()->canRefund()) {
        return $this->getCreditmemo()->getOrder()->getPayment()->canRefundPartialPerInvoice();
    }
    return true;
}

So payment method model must either declare:

$_canRefund = false;

Or

$_canRefund = true;
$_canRefundInvoicePartial = true;

Another thing to keep in mind is that availability of this option also depends on the type of the payment gateway. This option is always supported for offline, but sometimes won't be for online payment gateways. Reason for this is that sometimes they do not support partial refunds, or they were implemented poorly in Magento.

In case that refund is done online, payment method must implement following methods:

processBeforeRefund (optional)
refund
processCreditmemo (optional)