Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 90-93 (lines=4) @@
87
			$source_object   = $prepared_source->source_object;
88
89
			// Check if we don't allow prepaid credit cards.
90
			if ( ! apply_filters( 'wc_stripe_allow_prepaid_card', true ) && $this->is_prepaid_card( $source_object ) ) {
91
				$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' );
92
				throw new WC_Stripe_Exception( print_r( $source_object, true ), $localized_message );
93
			}
94
95
			if ( empty( $prepared_source->source ) ) {
96
				$localized_message = __( 'Payment processing failed. Please retry.', 'woocommerce-gateway-stripe' );

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

@@ 688-691 (lines=4) @@
685
			$prepared_source = $this->prepare_source( get_current_user_id(), $force_save_source );
686
687
			// Check if we don't allow prepaid credit cards.
688
			if ( ! apply_filters( 'wc_stripe_allow_prepaid_card', true ) && $this->is_prepaid_card( $prepared_source->source_object ) ) {
689
				$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' );
690
				throw new WC_Stripe_Exception( print_r( $prepared_source->source_object, true ), $localized_message );
691
			}
692
693
			if ( empty( $prepared_source->source ) ) {
694
				$localized_message = __( 'Payment processing failed. Please retry.', 'woocommerce-gateway-stripe' );