Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 519-528 (lines=10) @@
516
		if ( $response->captured ) {
517
			$order->payment_complete( $response->id );
518
			WC_Stripe::log( "Successful charge: $response->id" );
519
		} else {
520
			add_post_meta( $order->id, '_transaction_id', $response->id, true );
521
522
			if ( $order->has_status( array( 'pending', 'failed' ) ) ) {
523
				$order->reduce_order_stock();
524
			}
525
526
			$order->update_status( 'on-hold', sprintf( __( 'Stripe charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization.', 'woocommerce-gateway-stripe' ), $response->id ) );
527
			WC_Stripe::log( "Successful auth: $response->id" );
528
		}
529
530
		return $response;
531
	}

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

@@ 707-716 (lines=10) @@
704
			$order->add_order_note( $message );
705
			WC_Stripe::log( 'Success: ' . $message );
706
707
		} else {
708
			add_post_meta( $order->id, '_transaction_id', $response->id, true );
709
710
			if ( $order->has_status( array( 'pending', 'failed' ) ) ) {
711
				$order->reduce_order_stock();
712
			}
713
714
			$order->update_status( 'on-hold', sprintf( __( 'Stripe charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization.', 'woocommerce-gateway-stripe' ), $response->id ) );
715
			WC_Stripe::log( "Successful auth: $response->id" );
716
		}
717
718
		return $response;
719
	}