Code Duplication    Length = 16-16 lines in 2 locations

includes/legacy/class-wc-gateway-stripe.php 1 location

@@ 301-316 (lines=16) @@
298
		);
299
300
		// If we're on the pay page we need to pass stripe.js the address of the order.
301
		if ( is_checkout_pay_page() && isset( $_GET['order'] ) && isset( $_GET['order_id'] ) ) {
302
			$order_key = urldecode( $_GET['order'] );
303
			$order_id  = absint( $_GET['order_id'] );
304
			$order     = wc_get_order( $order_id );
305
306
			if ( $order->id === $order_id && $order->order_key === $order_key ) {
307
				$stripe_params['billing_first_name'] = $order->billing_first_name;
308
				$stripe_params['billing_last_name']  = $order->billing_last_name;
309
				$stripe_params['billing_address_1']  = $order->billing_address_1;
310
				$stripe_params['billing_address_2']  = $order->billing_address_2;
311
				$stripe_params['billing_state']      = $order->billing_state;
312
				$stripe_params['billing_city']       = $order->billing_city;
313
				$stripe_params['billing_postcode']   = $order->billing_postcode;
314
				$stripe_params['billing_country']    = $order->billing_country;
315
			}
316
		}
317
318
		wp_localize_script( 'woocommerce_stripe', 'wc_stripe_params', apply_filters( 'wc_stripe_params', $stripe_params ) );
319
	}

includes/class-wc-gateway-stripe.php 1 location

@@ 385-400 (lines=16) @@
382
		);
383
384
		// If we're on the pay page we need to pass stripe.js the address of the order.
385
		if ( is_checkout_pay_page() && isset( $_GET['order'] ) && isset( $_GET['order_id'] ) ) {
386
			$order_key = urldecode( $_GET['order'] );
387
			$order_id  = absint( $_GET['order_id'] );
388
			$order     = wc_get_order( $order_id );
389
390
			if ( $order->id === $order_id && $order->order_key === $order_key ) {
391
				$stripe_params['billing_first_name'] = $order->billing_first_name;
392
				$stripe_params['billing_last_name']  = $order->billing_last_name;
393
				$stripe_params['billing_address_1']  = $order->billing_address_1;
394
				$stripe_params['billing_address_2']  = $order->billing_address_2;
395
				$stripe_params['billing_state']      = $order->billing_state;
396
				$stripe_params['billing_city']       = $order->billing_city;
397
				$stripe_params['billing_postcode']   = $order->billing_postcode;
398
				$stripe_params['billing_country']    = $order->billing_country;
399
			}
400
		}
401
402
		$stripe_params['no_prepaid_card_msg']                     = __( 'Sorry, we\'re not accepting prepaid cards at this time.', 'woocommerce-gateway-stripe' );
403
		$stripe_params['allow_prepaid_card']                      = apply_filters( 'wc_stripe_allow_prepaid_card', true ) ? 'yes' : 'no';