Code Duplication    Length = 6-7 lines in 2 locations

includes/shortcodes/class-wc-shortcode-checkout.php 1 location

@@ 199-204 (lines=6) @@
196
		$order_id  = apply_filters( 'woocommerce_thankyou_order_id', absint( $order_id ) );
197
		$order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) );
198
199
		if ( $order_id > 0 ) {
200
			$order = wc_get_order( $order_id );
201
			if ( $order->order_key != $order_key ) {
202
				$order = false;
203
			}
204
		}
205
206
		// Empty awaiting payment session
207
		unset( WC()->session->order_awaiting_payment );

includes/wc-cart-functions.php 1 location

@@ 133-139 (lines=7) @@
130
		$order_id  = absint( $wp->query_vars['order-received'] );
131
		$order_key = isset( $_GET['key'] ) ? wc_clean( $_GET['key'] ) : '';
132
133
		if ( $order_id > 0 ) {
134
			$order = wc_get_order( $order_id );
135
136
			if ( $order->order_key === $order_key ) {
137
				WC()->cart->empty_cart();
138
			}
139
		}
140
	}
141
142
	if ( WC()->session->order_awaiting_payment > 0 ) {