I am getting following error in magento admin panel : PayPal gateway has rejected request. Authorization is voided (#10600: Authorization voided). I have voided the transaction from paypal account and now want to cancel the order from magento but above error occurs. The credit memo correlated to the voided Paypal transaction cannot be created since the invoice of the transaction is in cancelled status.
The administrator should manually create an Offline Credit Memo to correlate with the voided Paypal transaction.
Refer to code:
$canVoid = $this->getOrder()->getPayment()->canVoid($this);
This may be a help to you.
Check this LINK for more explanation on void function.