Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 433-437 (lines=5) @@
430
			$order  = wc_get_order( $order_id );
431
			$source = $this->get_source( get_current_user_id(), $force_customer );
432
433
			if ( empty( $source->source ) && empty( $source->customer ) ) {
434
				$error_msg = __( 'Please enter your card details to make a payment.', 'woocommerce-gateway-stripe' );
435
				$error_msg .= ' ' . __( 'Developers: Please make sure that you are including jQuery and there are no JavaScript errors on the page.', 'woocommerce-gateway-stripe' );
436
				throw new Exception( $error_msg );
437
			}
438
439
			// Store source to order meta
440
			$this->save_source( $order, $source );

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

@@ 593-597 (lines=5) @@
590
			$order  = wc_get_order( $order_id );
591
			$source = $this->get_source( get_current_user_id(), $force_customer );
592
593
			if ( empty( $source->source ) && empty( $source->customer ) ) {
594
				$error_msg = __( 'Please enter your card details to make a payment.', 'woocommerce-gateway-stripe' );
595
				$error_msg .= ' ' . __( 'Developers: Please make sure that you are including jQuery and there are no JavaScript errors on the page.', 'woocommerce-gateway-stripe' );
596
				throw new Exception( $error_msg );
597
			}
598
599
			// Store source to order meta.
600
			$this->save_source( $order, $source );