Code Duplication    Length = 3-3 lines in 2 locations

includes/librairies/payments/payment.class.php 1 location

@@ 553-555 (lines=3) @@
550
			$key = self::get_order_waiting_payment_array_id( $order_id, $params_array['method']);
551
			$order_grand_total = $order_meta['order_grand_total'];
552
			$total_received = ( ( !empty($params_array['status']) && ( $params_array['status'] == 'payment_received') && ($bank_response == 'completed') && !empty($params_array['received_amount']) ) ? $params_array['received_amount'] : 0 );
553
			foreach ( $order_meta['order_payment']['received'] as $received ) {
554
				$total_received += ( ( !empty($received['status']) && ( $received['status'] == 'payment_received') && ($bank_response == 'completed') && !empty($received['received_amount']) ) ? $received['received_amount'] : 0 );
555
			}
556
			$order_meta['order_amount_to_pay_now'] = $order_grand_total - $total_received;
557
			$order_meta['order_payment']['received'][$key] = self::add_new_payment_to_order( $order_id, $order_meta, $key, $params_array, $bank_response );
558

includes/modules/wps_cart/controller/wps_cart_ctr.php 1 location

@@ 734-736 (lines=3) @@
731
		// Total to pay now
732
		$total_received = 0;
733
		if( !empty( $cart_infos['order_payment']['received'] ) ) {
734
			foreach( $cart_infos['order_payment']['received'] as $received ) {
735
				$total_received += ( ( !empty($received['status']) && ( $received['status'] == 'payment_received') && !empty($received['received_amount']) ) ? $received['received_amount'] : 0 );
736
			}
737
		}
738
		$cart_infos['order_amount_to_pay_now'] = $cart_infos['order_grand_total'] - $total_received;
739