Log in
Model

CanRefund

Magento\Sales\Model\Order\Validation\CanRefund

What it does

This validator class determines whether a Magento 2 order is eligible for a credit memo (refund).

Developers use this class when implementing refund functionality to ensure orders meet specific criteria - they cannot be in payment review, on hold, canceled, or closed states, and must have sufficient paid amounts available for refund.

The validator also handles edge cases like zero grand total orders based on system configuration.

Public Methods

  • validate()