Example #1
0
 public function checkout_check()
 {
     //load credit card helper
     $this->CI->load->helper('credit_card_helper');
     $error_msg = lang('fix_errors') . "<BR><UL>";
     $error_list = "";
     //Verify name field
     if (empty($_POST["CardHolder"])) {
         $error_list .= "<LI>" . lang('enter_name') . "</LI>";
     }
     //Verify date
     if (!card_expiry_valid($_POST["ExpiryDate_mm"], $_POST["ExpiryDate_yy"])) {
         $error_list .= "<LI>" . lang('fix_exp_date') . "</LI>";
     }
     //Verify card number
     if (empty($_POST["CardNumber"]) || !card_number_valid($_POST["CardNumber"])) {
         $error_list .= "<LI>" . lang('fix_card_num') . "</LI>";
     }
     //Verify security code
     if (empty($_POST["CV2"])) {
         $error_list .= "<LI>" . lang('enter_cvv') . "</LI>";
     }
     // We need to store the credit card information temporarily
     $sp_tmp_data["sp_data"] = $_POST;
     $this->CI->session->set_userdata($sp_tmp_data);
     if ($error_list) {
         return $error_msg . $error_list . "</UL>";
     } else {
         return false;
     }
 }
Example #2
0
 function checkout_check()
 {
     $error_msg = "Please fix the following errors:<BR><UL>";
     $error_list = "";
     //Verify name field
     if (empty($_POST["x_first_name"]) || empty($_POST["x_last_name"])) {
         $error_list .= "<LI>Please enter your first and last name as it appears on the card</LI>";
     }
     //Verify date
     if (!card_expiry_valid($_POST["x_exp_date_mm"], $_POST["x_exp_date_yy"])) {
         $error_list .= "<LI>The expiration date does not appear to be valid</LI>";
     }
     //Verify card number
     if (empty($_POST["x_card_num"]) || !card_number_valid($_POST["x_card_num"])) {
         $error_list .= "<LI>The card number you entered is not a valid credit card number</LI>";
     }
     //Verify security code
     if (empty($_POST["x_card_code"])) {
         $error_list .= "<LI>Please enter the three digit security code on the reverse side of the card</LI>";
     }
     // We need to store the credit card information temporarily
     $cc_tmp_data["cc_data"] = $_POST;
     $this->CI->session->set_userdata($cc_tmp_data);
     if ($error_list) {
         return $error_msg . $error_list . "</UL>";
     } else {
         return false;
     }
 }
 function checkout_check()
 {
     $error_msg = lang('please_fix_errors') . '<BR><UL>';
     $error_list = "";
     //Verify name field
     if (empty($_POST["x_first_name"]) || empty($_POST["x_last_name"])) {
         $error_list .= '<LI>' . lang('enter_card_name') . '</LI>';
     }
     //Verify date
     if (!card_expiry_valid($_POST["x_exp_date_mm"], $_POST["x_exp_date_yy"])) {
         $error_list .= '<LI>' . lang('invalid_card_exp') . '</LI>';
     }
     //Verify card number
     if (empty($_POST["x_card_num"]) || !card_number_valid($_POST["x_card_num"])) {
         $error_list .= '<LI>' . lang('invalid_card_num') . '</LI>';
     }
     //Verify security code
     if (empty($_POST["x_card_code"])) {
         $error_list .= '<LI>' . lang('enter_card_code') . '</LI>';
     }
     // We need to store the credit card information temporarily
     $cc_tmp_data["cc_data"] = $_POST;
     $this->CI->session->set_userdata($cc_tmp_data);
     if ($error_list) {
         return $error_msg . $error_list . "</UL>";
     } else {
         return false;
     }
 }
Example #4
0
 function checkout_check()
 {
     $error_msg = '';
     $error_list = "";
     //Verify name field
     if (empty($_POST["customerName"])) {
         $error_list .= 'Please enter name<br>';
     }
     //Verify date
     if (!card_expiry_valid($_POST["expirationMonth"], $_POST["expirationYear"])) {
         $error_list .= 'Invalid card expiration value<br>';
     }
     //Verify card number
     if (empty($_POST["cardNumber"]) || !card_number_valid($_POST["cardNumber"])) {
         $error_list .= 'Invalid card number<br>';
     }
     //Verify security code
     if (empty($_POST["cvvNumber"])) {
         $error_list .= 'Please enter cvv number<br>';
     }
     // We need to store the credit card information temporarily
     $cc_tmp_data["cc_data"] = $_POST;
     $this->CI->session->set_userdata($cc_tmp_data);
     if ($error_list) {
         return $error_msg . $error_list . "";
     } else {
         return false;
     }
 }