Automattic\WooCommerce\Internal\RestApi\Routes\V4\Refunds

Controller::is_valid_refund_for_requestprotectedWC 1.0

Check if an order is valid.

Method of the class: Controller{}

No Hooks.

Returns

true|false. True if the refund is valid, false otherwise.

Usage

// protected - for code of main (parent) or child class
$result = $this->is_valid_refund_for_request( $refund ): bool;
$refund(WC_Order_Refund) (required)
The refund object.

Controller::is_valid_refund_for_request() code WC 10.4.3

protected function is_valid_refund_for_request( $refund ): bool {
	return $refund instanceof WC_Order_Refund && $refund->get_id() !== 0 && 'shop_order_refund' === $refund->get_type();
}