Code Duplication    Length = 14-16 lines in 2 locations

includes/class-wc-stripe-webhook-handler.php 2 locations

@@ 726-741 (lines=16) @@
723
			// Process valid response.
724
			$this->process_response( $charge, $order );
725
726
		} else {
727
			$error_message = $intent->last_payment_error ? $intent->last_payment_error->message : "";
728
729
			/* translators: 1) The error message that was received from Stripe. */
730
			$message = sprintf( __( 'Stripe SCA authentication failed. Reason: %s', 'woocommerce-gateway-stripe' ), $error_message );
731
732
			if ( ! $order->get_meta( '_stripe_status_final', false ) ) {
733
				$order->update_status( 'failed', $message );
734
			} else {
735
				$order->add_order_note( $message );
736
			}
737
738
			do_action( 'wc_gateway_stripe_process_webhook_payment_error', $order, $notification );
739
740
			$this->send_failed_order_email( $order_id );
741
		}
742
743
		$this->unlock_order_payment( $order );
744
	}
@@ 771-784 (lines=14) @@
768
			} else {
769
				$order->payment_complete();
770
			}
771
		} else {
772
			$error_message = $intent->last_setup_error ? $intent->last_setup_error->message : "";
773
774
			/* translators: 1) The error message that was received from Stripe. */
775
			$message = sprintf( __( 'Stripe SCA authentication failed. Reason: %s', 'woocommerce-gateway-stripe' ), $error_message );
776
777
			if ( ! $order->get_meta( '_stripe_status_final', false ) ) {
778
				$order->update_status( 'failed', $message );
779
			} else {
780
				$order->add_order_note( $message );
781
			}
782
783
			$this->send_failed_order_email( $order_id );
784
		}
785
786
		$this->unlock_order_payment( $order );
787
	}