Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 220-226 (lines=7) @@
217
		$packages[0]['destination']['postcode']  = $postcode;
218
		$packages[0]['destination']['city']      = $city;
219
220
		foreach ( WC()->cart->get_cart() as $item ) {
221
			if ( $item['data']->needs_shipping() ) {
222
				if ( isset( $item['line_total'] ) ) {
223
					$packages[0]['contents_cost'] += $item['line_total'];
224
				}
225
			}
226
		}
227
228
		$packages = apply_filters( 'woocommerce_cart_shipping_packages', $packages );
229

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

@@ 166-172 (lines=7) @@
163
		$packages[0]['destination']['address']   = $posted['address'];
164
		$packages[0]['destination']['address_2'] = $posted['address_2'];
165
166
		foreach ( WC()->cart->get_cart() as $item ) {
167
			if ( $item['data']->needs_shipping() ) {
168
				if ( isset( $item['line_total'] ) ) {
169
					$packages[0]['contents_cost'] += $item['line_total'];
170
				}
171
			}
172
		}
173
174
		$packages = apply_filters( 'woocommerce_cart_shipping_packages', $packages );
175