Code Duplication    Length = 3-3 lines in 5 locations

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

@@ 447-449 (lines=3) @@
444
			// Handle payment
445
			if ( $order->get_total() > 0 ) {
446
447
				if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) {
448
					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 ) ) );
449
				}
450
451
				WC_Stripe::log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" );
452

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

@@ 711-713 (lines=3) @@
708
			// Handle payment.
709
			if ( $order->get_total() > 0 ) {
710
711
				if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) {
712
					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 ) ) );
713
				}
714
715
				$this->log( "Info: Begin processing payment for order {$order_id} for the amount of {$order->get_total()}" );
716

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

@@ 760-762 (lines=3) @@
757
			// Handle payment.
758
			if ( $order->get_total() > 0 ) {
759
760
				if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) {
761
					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 ) ) );
762
				}
763
764
				$this->log( "Info: Begin processing payment for order $order_id for the amount of {$order->get_total()}" );
765

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

@@ 110-112 (lines=3) @@
107
	 * @param  bool initial_payment
108
	 */
109
	public function process_subscription_payment( $order = '', $amount = 0 ) {
110
		if ( $amount * 100 < WC_Stripe::get_minimum_amount() ) {
111
			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 ) ) );
112
		}
113
114
		// Get source from order
115
		$source = $this->get_order_source( $order );
@@ 170-172 (lines=3) @@
167
			try {
168
				$order = wc_get_order( $order_id );
169
170
				if ( $order->get_total() * 100 < WC_Stripe::get_minimum_amount() ) {
171
					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 ) ) );
172
				}
173
174
				$source = $this->get_source( get_current_user_id(), true );
175