Code Duplication    Length = 7-7 lines in 2 locations

includes/api/class-wc-api-orders.php 2 locations

@@ 324-330 (lines=7) @@
321
				'amount' => wc_format_decimal( $coupon_item['discount_amount'], $dp ),
322
			);
323
324
			if ( in_array( 'coupons', $expand ) ) {
325
				$_coupon_data = WC()->api->WC_API_Coupons->get_coupon_by_code( $coupon_item['name'] );
326
327
				if ( isset( $_coupon_data['coupon'] ) ) {
328
					$coupon_line['coupon_data'] = $_coupon_data['coupon'];
329
				}
330
			}
331
332
			$order_data['coupon_lines'][] = $coupon_line;
333
		}
@@ 262-268 (lines=7) @@
259
				'meta'         => $item_meta,
260
			);
261
262
			if ( in_array( 'products', $expand ) ) {
263
				$_product_data = WC()->api->WC_API_Products->get_product( $product_id );
264
265
				if ( isset( $_product_data['product'] ) ) {
266
					$line_item['product_data'] = $_product_data['product'];
267
				}
268
			}
269
270
			$order_data['line_items'][] = $line_item;
271
		}