You can perform a refund in Magento by creating a credit memo.
- Select Sales - Invoices.
- From the list of invoices, select the one you want to refund.
When the invoice opens, click the Credit Memo button. Note that the Credit Memo option appears only if an invoice has been generated for the order.
The New Credit Memo page opens. It looks similar to the Completed Order page, with an Items to Refund section that lists each item from the invoice.
- Adjust the refund quantities and totals, then click Refund. Note that the Refund Offline option will not initiate a refund through MasterCard Payment Gateway Services.