Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 250-256 (lines=7) @@
247
		$packages[0]['destination']['postcode']  = $postcode;
248
		$packages[0]['destination']['city']      = $city;
249
250
		foreach ( WC()->cart->get_cart() as $item ) {
251
			if ( $item['data']->needs_shipping() ) {
252
				if ( isset( $item['line_total'] ) ) {
253
					$packages[0]['contents_cost'] += $item['line_total'];
254
				}
255
			}
256
		}
257
258
		$packages = apply_filters( 'woocommerce_cart_shipping_packages', $packages );
259

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

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