Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 495-498 (lines=4) @@
492
	 * @throws WC_Stripe_Exception     An exception if the source ID is missing.
493
	 */
494
	public function check_source( $prepared_source ) {
495
		if ( empty( $prepared_source->source ) ) {
496
			$localized_message = __( 'Payment processing failed. Please retry.', 'woocommerce-gateway-stripe' );
497
			throw new WC_Stripe_Exception( print_r( $prepared_source, true ), $localized_message );
498
		}
499
	}
500
501
	/**

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

@@ 184-187 (lines=4) @@
181
			$subscription    = wc_get_order( $order_id );
182
			$prepared_source = $this->prepare_source( get_current_user_id(), true );
183
184
			if ( empty( $prepared_source->source ) ) {
185
				$localized_message = __( 'Payment processing failed. Please retry.', 'woocommerce-gateway-stripe' );
186
				throw new WC_Stripe_Exception( print_r( $prepared_source, true ), $localized_message );
187
			}
188
189
			$this->save_source_to_order( $subscription, $prepared_source );
190