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

@@ 663-672 (lines=10) @@
660
			$order->add_order_note( $message );
661
			WC_Stripe::log( 'Success: ' . $message );
662
663
		} else {
664
			add_post_meta( $order->id, '_transaction_id', $response->id, true );
665
666
			if ( $order->has_status( array( 'pending', 'failed' ) ) ) {
667
				$order->reduce_order_stock();
668
			}
669
670
			$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 ) );
671
			WC_Stripe::log( "Successful auth: $response->id" );
672
		}
673
674
		return $response;
675
	}