Code Duplication    Length = 9-9 lines in 4 locations

includes/process-donation.php 4 locations

@@ 606-614 (lines=9) @@
603
	) {
604
		
605
		// Validate card number field for empty check.
606
		if (
607
			isset( $posted_data['card_number'] ) &&
608
			empty( $posted_data['card_number'] )
609
		) {
610
			$required_fields['card_number'] = array(
611
				'error_id'      => 'empty_card_number',
612
				'error_message' => __( 'Please enter a credit card number.', 'give' ),
613
			);
614
		}
615
		
616
		// Validate card cvc field for empty check.
617
		if (
@@ 617-625 (lines=9) @@
614
		}
615
		
616
		// Validate card cvc field for empty check.
617
		if (
618
			isset( $posted_data['card_cvc'] ) &&
619
			empty( $posted_data['card_cvc'] )
620
		) {
621
			$required_fields['card_cvc'] = array(
622
				'error_id'      => 'empty_card_cvc',
623
				'error_message' => __( 'Please enter a credit card CVC information.', 'give' ),
624
			);
625
		}
626
		
627
		// Validate card name field for empty check.
628
		if (
@@ 628-636 (lines=9) @@
625
		}
626
		
627
		// Validate card name field for empty check.
628
		if (
629
			isset( $posted_data['card_name'] ) &&
630
			empty( $posted_data['card_name'] )
631
		) {
632
			$required_fields['card_name'] = array(
633
				'error_id'      => 'empty_card_name',
634
				'error_message' => __( 'Please enter a name of your credit card account holder.', 'give' ),
635
			);
636
		}
637
		
638
		// Validate card expiry field for empty check.
639
		if (
@@ 639-647 (lines=9) @@
636
		}
637
		
638
		// Validate card expiry field for empty check.
639
		if (
640
			isset( $posted_data['card_expiry'] ) &&
641
			empty( $posted_data['card_expiry'] )
642
		) {
643
			$required_fields['card_expiry'] = array(
644
				'error_id'      => 'empty_card_expiry',
645
				'error_message' => __( 'Please enter a credit card expiry date.', 'give' ),
646
			);
647
		}
648
	}
649
650
	$require_address = give_require_billing_address( $payment_mode );