Code Duplication    Length = 29-29 lines in 2 locations

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

@@ 850-878 (lines=29) @@
847
	 *
848
	 * @param int $order_id
849
	 */
850
	public function display_order_fee( $order_id ) {
851
		if ( apply_filters( 'wc_stripe_hide_display_order_fee', false, $order_id ) ) {
852
			return;
853
		}
854
855
		$order = wc_get_order( $order_id );
856
857
		$fee      = WC_Stripe_Helper::get_stripe_fee( $order );
858
		$currency = WC_Stripe_Helper::get_stripe_currency( $order );
859
860
		if ( ! $fee || ! $currency ) {
861
			return;
862
		}
863
864
		?>
865
866
		<tr>
867
			<td class="label stripe-fee">
868
				<?php echo wc_help_tip( __( 'This represents the fee Stripe collects for the transaction.', 'woocommerce-gateway-stripe' ) ); ?>
869
				<?php esc_html_e( 'Stripe Fee:', 'woocommerce-gateway-stripe' ); ?>
870
			</td>
871
			<td width="1%"></td>
872
			<td class="total">
873
				-&nbsp;<?php echo wc_price( $fee, array( 'currency' => $currency ) ); ?>
874
			</td>
875
		</tr>
876
877
		<?php
878
	}
879
880
	/**
881
	 * Displays the net total of the transaction without the charges of Stripe.
@@ 887-915 (lines=29) @@
884
	 *
885
	 * @param int $order_id
886
	 */
887
	public function display_order_payout( $order_id ) {
888
		if ( apply_filters( 'wc_stripe_hide_display_order_payout', false, $order_id ) ) {
889
			return;
890
		}
891
892
		$order = wc_get_order( $order_id );
893
894
		$net      = WC_Stripe_Helper::get_stripe_net( $order );
895
		$currency = WC_Stripe_Helper::get_stripe_currency( $order );
896
897
		if ( ! $net || ! $currency ) {
898
			return;
899
		}
900
901
		?>
902
903
		<tr>
904
			<td class="label stripe-payout">
905
				<?php echo wc_help_tip( __( 'This represents the net total that will be credited to your Stripe bank account. This may be in the currency that is set in your Stripe account.', 'woocommerce-gateway-stripe' ) ); ?>
906
				<?php esc_html_e( 'Stripe Payout:', 'woocommerce-gateway-stripe' ); ?>
907
			</td>
908
			<td width="1%"></td>
909
			<td class="total">
910
				<?php echo wc_price( $net, array( 'currency' => $currency ) ); ?>
911
			</td>
912
		</tr>
913
914
		<?php
915
	}
916
}
917