Code Duplication    Length = 10-10 lines in 2 locations

includes/class-wc-gateway-stripe.php 2 locations

@@ 281-290 (lines=10) @@
278
		$user_email           = '';
279
280
		// If paying from order, we need to get total from order not cart.
281
		if ( isset( $_GET['pay_for_order'] ) && ! empty( $_GET['key'] ) ) {
282
			$order      = wc_get_order( wc_get_order_id_by_order_key( wc_clean( $_GET['key'] ) ) );
283
			$total      = $order->get_total();
284
			$user_email = WC_Stripe_Helper::is_pre_30() ? $order->billing_email : $order->get_billing_email();
285
		} else {
286
			if ( $user->ID ) {
287
				$user_email = get_user_meta( $user->ID, 'billing_email', true );
288
				$user_email = $user_email ? $user_email : $user->user_email;
289
			}
290
		}
291
292
		if ( is_add_payment_method_page() ) {
293
			$pay_button_text = __( 'Add Card', 'woocommerce-gateway-stripe' );
@@ 534-543 (lines=10) @@
531
		$display_tokenization = $this->supports( 'tokenization' ) && $this->saved_cards;
532
533
		// If paying from order, we need to get total from order not cart.
534
		if ( ! empty( $_GET['key'] ) ) {
535
			$order      = wc_get_order( wc_get_order_id_by_order_key( wc_clean( $_GET['key'] ) ) );
536
			$total      = $order->get_total();
537
			$user_email = WC_Stripe_Helper::is_pre_30() ? $order->billing_email : $order->get_billing_email();
538
		} else {
539
			if ( $user->ID ) {
540
				$user_email = get_user_meta( $user->ID, 'billing_email', true );
541
				$user_email = $user_email ? $user_email : $user->user_email;
542
			}
543
		}
544
545
		ob_start();
546