Log in
Model

RefundInvoice

Magento\Sales\Model\RefundInvoice

What it does

This class handles the business logic for refunding an invoice in Magento 2.

Developers would use this class (or its interface RefundInvoiceInterface) when programmatically creating credit memos to refund customer payments, whether processing online refunds through payment gateways or offline refunds.

It validates the refund request, creates the credit memo document, processes the refund through the payment adapter, and updates order and invoice states accordingly.

Public Methods

  • execute()