Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 617-622 (lines=6) @@
614
			$prepared_source = $this->prepare_source( $source_object, get_current_user_id(), $force_save_source );
615
616
			// Check if we don't allow prepaid credit cards.
617
			if ( ! apply_filters( 'wc_stripe_allow_prepaid_card', true ) ) {
618
				if ( $source_object && 'token' === $source_object->object && 'prepaid' === $source_object->card->funding ) {
619
					$localized_message = __( 'Sorry, we\'re not accepting prepaid cards at this time. Your credit card has not been charge. Please try with alternative payment method.', 'woocommerce-gateway-stripe' );
620
					throw new WC_Stripe_Exception( print_r( $source_object, true ), $localized_message );
621
				}
622
			}
623
624
			if ( empty( $prepared_source->source ) ) {
625
				$localized_message = __( 'Payment processing failed. Please retry.', 'woocommerce-gateway-stripe' );

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

@@ 95-100 (lines=6) @@
92
			$prepared_source = $this->prepare_source( $source_object, get_current_user_id(), true );
93
94
			// Check if we don't allow prepaid credit cards.
95
			if ( ! apply_filters( 'wc_stripe_allow_prepaid_card', true ) ) {
96
				if ( $source_object && 'token' === $source_object->object && 'prepaid' === $source_object->card->funding ) {
97
					$localized_message = __( 'Sorry, we\'re not accepting prepaid cards at this time. Your credit card has not been charge. Please try with alternative payment method.', 'woocommerce-gateway-stripe' );
98
					throw new WC_Stripe_Exception( print_r( $source_object, true ), $localized_message );
99
				}
100
			}
101
102
			if ( empty( $prepared_source->source ) ) {
103
				$localized_message = __( 'Payment processing failed. Please retry.', 'woocommerce-gateway-stripe' );