Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 359-361 (lines=3) @@
356
357
			if ( ! isset( $payment_meta['post_meta']['_stripe_customer_id']['value'] ) || empty( $payment_meta['post_meta']['_stripe_customer_id']['value'] ) ) {
358
				throw new Exception( __( 'A "Stripe Customer ID" value is required.', 'woocommerce-gateway-stripe' ) );
359
			} elseif ( 0 !== strpos( $payment_meta['post_meta']['_stripe_customer_id']['value'], 'cus_' ) ) {
360
				throw new Exception( __( 'Invalid customer ID. A valid "Stripe Customer ID" must begin with "cus_".', 'woocommerce-gateway-stripe' ) );
361
			}
362
363
			if (
364
				( ! empty( $payment_meta['post_meta']['_stripe_source_id']['value'] )

includes/compat/class-wc-stripe-sepa-compat.php 1 location

@@ 306-308 (lines=3) @@
303
304
			if ( ! isset( $payment_meta['post_meta']['_stripe_customer_id']['value'] ) || empty( $payment_meta['post_meta']['_stripe_customer_id']['value'] ) ) {
305
				throw new Exception( 'A "_stripe_customer_id" value is required.' );
306
			} elseif ( 0 !== strpos( $payment_meta['post_meta']['_stripe_customer_id']['value'], 'cus_' ) ) {
307
				throw new Exception( 'Invalid customer ID. A valid "_stripe_customer_id" must begin with "cus_".' );
308
			}
309
310
			if ( ! isset( $payment_meta['post_meta']['_stripe_source_id']['value'] ) || empty( $payment_meta['post_meta']['_stripe_source_id']['value'] ) ) {
311
				throw new Exception( 'A "_stripe_source_id" value is required.' );