Code Duplication    Length = 7-7 lines in 2 locations

includes/class-wc-stripe-apple-pay.php 1 location

@@ 566-572 (lines=7) @@
563
		$packages[0]['destination']['postcode']  = $postcode;
564
		$packages[0]['destination']['city']      = $city;
565
566
		foreach ( WC()->cart->get_cart() as $item ) {
567
			if ( $item['data']->needs_shipping() ) {
568
				if ( isset( $item['line_total'] ) ) {
569
					$packages[0]['contents_cost'] += $item['line_total'];
570
				}
571
			}
572
		}
573
574
		$packages = apply_filters( 'woocommerce_cart_shipping_packages', $packages );
575

includes/class-wc-stripe-payment-request.php 1 location

@@ 182-188 (lines=7) @@
179
		$packages[0]['destination']['address']   = $address_1;
180
		$packages[0]['destination']['address_2'] = $address_2;
181
182
		foreach ( WC()->cart->get_cart() as $item ) {
183
			if ( $item['data']->needs_shipping() ) {
184
				if ( isset( $item['line_total'] ) ) {
185
					$packages[0]['contents_cost'] += $item['line_total'];
186
				}
187
			}
188
		}
189
190
		$packages = apply_filters( 'woocommerce_cart_shipping_packages', $packages );
191