Code Duplication    Length = 29-29 lines in 2 locations

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

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