Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 507-510 (lines=4) @@
504
	 * @throws WC_Stripe_Exception     An exception if the source ID is missing.
505
	 */
506
	public function check_source( $prepared_source ) {
507
		if ( empty( $prepared_source->source ) ) {
508
			$localized_message = __( 'Payment processing failed. Please retry.', 'woocommerce-gateway-stripe' );
509
			throw new WC_Stripe_Exception( print_r( $prepared_source, true ), $localized_message );
510
		}
511
	}
512
513
	/**

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