Code Duplication    Length = 6-6 lines in 2 locations

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' );

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

@@ 496-501 (lines=6) @@
493
			$prepared_source = $this->prepare_source( $source_object, get_current_user_id(), $force_save_source );
494
495
			// Check if we don't allow prepaid credit cards.
496
			if ( ! apply_filters( 'wc_stripe_allow_prepaid_card', true ) ) {
497
				if ( $source_object && 'token' === $source_object->object && 'prepaid' === $source_object->card->funding ) {
498
					$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' );
499
					throw new WC_Stripe_Exception( print_r( $source_object, true ), $localized_message );
500
				}
501
			}
502
503
			if ( empty( $prepared_source->source ) ) {
504
				$localized_message = __( 'Payment processing failed. Please retry.', 'woocommerce-gateway-stripe' );