Code Duplication    Length = 3-3 lines in 5 locations

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

@@ 445-447 (lines=3) @@
442
			// Handle payment
443
			if ( $order->get_total() > 0 ) {
444
445
				if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) {
446
					throw new Exception( sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe::get_minimum_amount() / 100 ) ) );
447
				}
448
449
				WC_Stripe::log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" );
450

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

@@ 105-107 (lines=3) @@
102
	 * @param  bool initial_payment
103
	 */
104
	public function process_subscription_payment( $order = '', $amount = 0 ) {
105
		if ( $amount * 100 < WC_Stripe::get_minimum_amount() ) {
106
			return new WP_Error( 'stripe_error', sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe::get_minimum_amount() / 100 ) ) );
107
		}
108
109
		// Get source from order
110
		$source = $this->get_order_source( $order );
@@ 152-154 (lines=3) @@
149
			try {
150
				$order = wc_get_order( $order_id );
151
152
				if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) {
153
					throw new Exception( sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe::get_minimum_amount() / 100 ) ) );
154
				}
155
156
				$source = $this->get_source( get_current_user_id(), true );
157

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

@@ 755-757 (lines=3) @@
752
			// Handle payment.
753
			if ( $order->get_total() > 0 ) {
754
755
				if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) {
756
					throw new Exception( sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe::get_minimum_amount() / 100 ) ) );
757
				}
758
759
				$this->log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" );
760

includes/class-wc-stripe-apple-pay.php 1 location

@@ 709-711 (lines=3) @@
706
			// Handle payment.
707
			if ( $order->get_total() > 0 ) {
708
709
				if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) {
710
					return new WP_Error( 'stripe_error', sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe::get_minimum_amount() / 100 ) ) );
711
				}
712
713
				$this->log( "Info: Begin processing payment for order {$order_id} for the amount of {$order->get_total()}" );
714