From 21c37d4355f315674bf6a00030231810343ae29f Mon Sep 17 00:00:00 2001 From: Joldis Mihai Alexandru Date: Wed, 2 Oct 2013 14:01:30 +0300 Subject: [PATCH] Removed validation for credit card fields, to be done in each gateway file --- wpsc-includes/checkout.class.php | 46 -------------------------------- 1 file changed, 46 deletions(-) diff --git a/wpsc-includes/checkout.class.php b/wpsc-includes/checkout.class.php index ed6aa596b6..db083ce5a0 100644 --- a/wpsc-includes/checkout.class.php +++ b/wpsc-includes/checkout.class.php @@ -404,53 +404,7 @@ function validate_forms() { $wpsc_gateway_error_messages = array(); $wpsc_checkout_error_messages = array(); $wpsc_registration_error_messages = array(); - // Credit Card Number Validation for PayPal Pro and maybe others soon - if ( isset( $_POST['card_number'] ) ) { - //should do some php CC validation here~ - } else { - $wpsc_gateway_error_messages['card_number'] = ''; - } - if ( isset( $_POST['card_number1'] ) && isset( $_POST['card_number2'] ) && isset( $_POST['card_number3'] ) && isset( $_POST['card_number4'] ) ) { - if ( $_POST['card_number1'] != '' && $_POST['card_number2'] != '' && $_POST['card_number3'] != '' && $_POST['card_number4'] != '' && is_numeric( $_POST['card_number1'] ) && is_numeric( $_POST['card_number2'] ) && is_numeric( $_POST['card_number3'] ) && is_numeric( $_POST['card_number4'] ) ) { - $wpsc_gateway_error_messages['card_number'] = ''; - } else { - $any_bad_inputs = true; - $bad_input = true; - $wpsc_gateway_error_messages['card_number'] = __( 'Please enter a valid card number.', 'wpsc' ); - $wpsc_customer_checkout_details['card_number'] = ''; - } - } - if ( isset( $_POST['expiry'] ) ) { - if ( !empty($_POST['expiry']['month']) && !empty($_POST['expiry']['month']) && is_numeric( $_POST['expiry']['month'] ) && is_numeric( $_POST['expiry']['year'] ) ) { - $wpsc_gateway_error_messages['expdate'] = ''; - } else { - $any_bad_inputs = true; - $bad_input = true; - $wpsc_gateway_error_messages['expdate'] = __( 'Please enter a valid expiry date.', 'wpsc' ); - $wpsc_customer_checkout_details['expdate'] = ''; - } - } - if ( isset( $_POST['card_code'] ) ) { - if ( empty($_POST['card_code']) || (!is_numeric( $_POST['card_code'] )) ) { - $any_bad_inputs = true; - $bad_input = true; - $wpsc_gateway_error_messages['card_code'] = __( 'Please enter a valid CVV.', 'wpsc' ); - $wpsc_customer_checkout_details['card_code'] = ''; - } else { - $wpsc_gateway_error_messages['card_code'] = ''; - } - } - if ( isset( $_POST['cctype'] ) ) { - if ( $_POST['cctype'] == '' ) { - $any_bad_inputs = true; - $bad_input = true; - $wpsc_gateway_error_messages['cctype'] = __( 'Please enter a valid CVV.', 'wpsc' ); - $wpsc_customer_checkout_details['cctype'] = ''; - } else { - $wpsc_gateway_error_messages['cctype'] = ''; - } - } if ( isset( $_POST['log'] ) || isset( $_POST['pwd'] ) || isset( $_POST['user_email'] ) ) { $results = wpsc_add_new_user( $_POST['log'], $_POST['pwd'], $_POST['user_email'] ); if ( is_callable( array( $results, "get_error_code" ) ) && $results->get_error_code() ) {