Code Duplication    Length = 6-7 lines in 2 locations

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

@@ 190-195 (lines=6) @@
187
		$order_id  = apply_filters( 'woocommerce_thankyou_order_id', absint( $order_id ) );
188
		$order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) );
189
190
		if ( $order_id > 0 ) {
191
			$order = wc_get_order( $order_id );
192
			if ( $order->get_order_key() != $order_key ) {
193
				$order = false;
194
			}
195
		}
196
197
		// Empty awaiting payment session
198
		unset( WC()->session->order_awaiting_payment );

includes/wc-cart-functions.php 1 location

@@ 249-255 (lines=7) @@
246
		$order_id  = absint( $wp->query_vars['order-received'] );
247
		$order_key = isset( $_GET['key'] ) ? wc_clean( $_GET['key'] ) : '';
248
249
		if ( $order_id > 0 ) {
250
			$order = wc_get_order( $order_id );
251
252
			if ( $order->get_order_key() === $order_key ) {
253
				WC()->cart->empty_cart();
254
			}
255
		}
256
	}
257
258
	if ( WC()->session->order_awaiting_payment > 0 ) {