Automattic\WooCommerce\Internal\Admin

Analytics::get_refund_double_count_state │ public static │ WC 1.0

Get the state of the double-counted refunds fix tool, with defaults applied.

Method of the class: Analytics{}

No Hooks.

Returns

array{run_id: string, status: string, max_order_id: int, fixed: int, unresolved: int, batches: int, started_at: int, completed_at: int, dismissed: bool}.

Usage

$result = Analytics::get_refund_double_count_state(): array;

Analytics::get_refund_double_count_state() code WC 11.3.0

public static function get_refund_double_count_state(): array {
	$state = get_option( self::REFUND_DOUBLE_COUNT_OPTION );
	$state = is_array( $state ) ? $state : array();

	return array(
		'run_id'       => is_string( $state['run_id'] ?? null ) ? $state['run_id'] : '',
		'status'       => is_string( $state['status'] ?? null ) ? $state['status'] : '',
		'max_order_id' => absint( $state['max_order_id'] ?? 0 ),
		'fixed'        => absint( $state['fixed'] ?? 0 ),
		'unresolved'   => absint( $state['unresolved'] ?? 0 ),
		'batches'      => absint( $state['batches'] ?? 0 ),
		'started_at'   => absint( $state['started_at'] ?? 0 ),
		'completed_at' => absint( $state['completed_at'] ?? 0 ),
		'dismissed'    => ! empty( $state['dismissed'] ),
	);
}