Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFormProcessor::order_matches_form_data │ private │ WC 1.0

Whether a candidate order matches the submitted email and order number.

Method of the class: OrderWithdrawalFormProcessor{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->order_matches_form_data( $order, $data ): bool;
$order(WC_Order) (required)
Candidate order.
$data(array<string,string>) (required)
Form data.

OrderWithdrawalFormProcessor::order_matches_form_data() code WC 11.1.2

private function order_matches_form_data( WC_Order $order, array $data ): bool {
	return $this->normalize_order_number( (string) $order->get_order_number() ) === $this->normalize_order_number( $data[ self::FIELD_ORDER_NUMBER ] )
		&& $this->text_values_match( $order->get_billing_email( 'edit' ), $data[ self::FIELD_EMAIL ] );
}