Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFormProcessor::is_order_outside_withdrawal_window │ private │ WC 1.0

Whether the matched order is outside the valid withdrawal request window.

Method of the class: OrderWithdrawalFormProcessor{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->is_order_outside_withdrawal_window( $order ): bool;
$order(WC_Order) (required)
Matched order.

OrderWithdrawalFormProcessor::is_order_outside_withdrawal_window() code WC 11.1.2

private function is_order_outside_withdrawal_window( WC_Order $order ): bool {
	$date_created = $order->get_date_created( 'edit' );

	if ( ! $date_created ) {
		return false;
	}

	return ( time() - self::WITHDRAWAL_WINDOW_IN_SECONDS ) > $date_created->getTimestamp();
}