This is a discussion on Please help! Error message within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; Hello, I am a frustrated newbie at this point. I added a cvv contribution to my cart so that a ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
#1
| |||
| |||
| Hello, I am a frustrated newbie at this point. I added a cvv contribution to my cart so that a customer submits their cc# and cvv for me to run. (My website does not charge in real time, therefore I do it manually.) I am aware of the merchant rules on this, by the way... Anyways, upon testing I get an error message instead of a confirmation: Warning: Missing argument 4 for validate() in /home/fusion13/public_html/catalog/includes/classes/cc_validation.php on line 16 Warning: Cannot modify header information - headers already sent by (output started at /home/fusion13/public_html/catalog/includes/classes/cc_validation.php:16) in /home/fusion13/public_html/catalog/includes/functions/general.php on line 33 The cc_validation page shows: <?php /* $Id: cc_validation.php,v 1.3 2003/02/12 20:43:41 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions osCommerce, Open Source Online Shop E-Commerce Solutions Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class cc_validation { var $cc_type, $cc_number, $cc_expiry_month, $cc_expiry_year, $cc_cvv2; function validate($number, $expiry_m, $expiry_y, $cvv2) { $this->cc_number = ereg_replace('[^0-9]', '', $number); if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) { $this->cc_type = 'Visa'; } elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) { $this->cc_type = 'Master Card'; } elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) { $this->cc_type = 'American Express'; } elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) { $this->cc_type = 'Diners Club'; } elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) { $this->cc_type = 'Discover'; } elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) { $this->cc_type = 'JCB'; } elseif (ereg('^5610[0-9]{12}$', $this->cc_number)) { $this->cc_type = 'Australian BankCard'; } else { return -1; } if (is_numeric($expiry_m) && ($expiry_m > 0) && ($expiry_m < 13)) { $this->cc_expiry_month = $expiry_m; } else { return -2; } $current_year = date('Y'); $expiry_y = substr($current_year, 0, 2) . $expiry_y; if (is_numeric($expiry_y) && ($expiry_y >= $current_year) && ($expiry_y <= ($current_year + 10))) { $this->cc_expiry_year = $expiry_y; } else { return -3; } if ($expiry_y == $current_year) { if ($expiry_m < date('n')) { return -4; } } if ( (strlen($cvv2) < 3) or (strlen($cvv2) > 4)) { return -5; } return $this->is_valid(); } function is_valid() { $cardNumber = strrev($this->cc_number); $numSum = 0; for ($i=0; $i<strlen($cardNumber); $i++) { $currentNum = substr($cardNumber, $i, 1); // Double every second digit if ($i % 2 == 1) { $currentNum *= 2; } // Add digits of 2-digit numbers together if ($currentNum > 9) { $firstNum = $currentNum % 10; $secondNum = ($currentNum - $firstNum) / 10; $currentNum = $firstNum + $secondNum; } $numSum += $currentNum; } // If the total has no remainder it's OK return ($numSum % 10 == 0); } } ?> Any help would be appreciated! |
| Sponsored Links | ||
| ||
| |
|
#2
| |||
| |||
| You may want to look at cc_validation1.php I believe. I think it addressed these issues. You can find it in any number of credit class module downloads (I know it's in both the downloads for payflow). Hey, I found a copy. The code is below Code: <?php
/*
$Id: cc_validation1.php,v 1.1.1.1 2004/03/04 23:40:42 ccwjr Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
class cc_validation {
var $cc_type, $cc_number, $cc_expiry_month, $cc_expiry_year;
function validate($number, $expiry_m, $expiry_y) {
$this->cc_number = ereg_replace('[^0-9]', '', $number);
if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) {
$this->cc_type = 'Visa';
} elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) {
$this->cc_type = 'Master Card';
} elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) {
$this->cc_type = 'American Express';
} elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) {
$this->cc_type = 'Diners Club';
} elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) {
$this->cc_type = 'Discover';
} elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) {
$this->cc_type = 'JCB';
} elseif (ereg('^5610[0-9]{12}$', $this->cc_number)) {
$this->cc_type = 'Australian BankCard';
} else {
return -1;
}
if (is_numeric($expiry_m) && ($expiry_m > 0) && ($expiry_m < 13)) {
$this->cc_expiry_month = $expiry_m;
} else {
return -2;
}
$current_year = date('Y');
$expiry_y = substr($current_year, 0, 2) . $expiry_y;
if (is_numeric($expiry_y) && ($expiry_y >= $current_year) && ($expiry_y <= ($current_year + 10))) {
$this->cc_expiry_year = $expiry_y;
} else {
return -3;
}
if ($expiry_y == $current_year) {
if ($expiry_m < date('n')) {
return -4;
}
}
return $this->is_valid();
}
function is_valid() {
$cardNumber = strrev($this->cc_number);
$numSum = 0;
for ($i=0; $i<strlen($cardNumber); $i++) {
$currentNum = substr($cardNumber, $i, 1);
// Double every second digit
if ($i % 2 == 1) {
$currentNum *= 2;
}
// Add digits of 2-digit numbers together
if ($currentNum > 9) {
$firstNum = $currentNum % 10;
$secondNum = ($currentNum - $firstNum) / 10;
$currentNum = $firstNum + $secondNum;
}
$numSum += $currentNum;
}
// If the total has no remainder it's OK
return ($numSum % 10 == 0);
}
}
?>
__________________ so endith the lesson<think>sometimes I just sit's and thinks</think> "Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB |
| The Following User Says Thank You to met00 For This Useful Post: | ||
chobo10 (06-13-2007) | ||
|
#3
| |||
| |||
| which cvv contribution are you using? I added one a little while back that addresses the offline processing etc. and it works great for me. http://www.oscmax.com/node/152 |
|
#4
| |||
| |||
| Awesome! The cc_verification file attached worked. I am using cvv2_version2_1 in the contributions list by penguin man, by the way. Now I have a new problem. I am a total rookie. When I go to confirm the test order I get 500 internal server error and a 404 page not found. The error log says Premature end of script headers: /home/fusion13/public_html/catalog/checkout_process.php How do I correct that? Last edited by chobo10; 06-13-2007 at 06:06 PM. |
|
#5
| |||
| |||
| Since you are using the cc_verification.php from one mod mixed with another this could cause your error. You may have to use the complete mod. |
|
#6
| |||
| |||
| You are right - I have made so many changes I will start fresh with the contribution you suggested. Question - I tried restoring my backed up database from the night before I started all this and it appears that the code on the pages does not revert to the original. How do I start over clean without losing my customer/product data? |
|
#7
| |||
| |||
| The database just stores information like customers,orders etc. You would have needed to back up the files that your changed before changing them. You could reupload just the files you changed from a stock oscmax |
|
#8
| |||
| |||
| Thank you. By the way, I tried installing the http://www.oscmax.com/node/152. I noticed several things: I am missing the paypal and fedex modules to alter, in admin/orders.php and they are not in my original clean copy either I downloaded. I also cannot find the javascript/checkout payment.js.php. I also don't have permission to write to the admin/includes/function general file. My website was working fairly well before. All I wanted was to add the cvv request to look more professional. I feel I'm over my head on this stuff, and have made a really big mess. Do you know anyone, or where I can post to pay someone to install a clean cvv contribution for me? At this point I think I need ask my server to restore my database, (luckily they back up every night), restore my back up and let a pro handle it. Thanks again, Cynthia |
|
#9
| |||
| |||
| First what version of oscmax. Next did you back up the files you were going to change prior to trying to add the cvv w/encryption contrib. and do you have those. nothing can be that big of a mess. |
|
#10
| |||
| |||
| I wish I could have worked it out myself without falling in to despair. It is has been fun and rewarding when I succeeded. I've become afraid, though of really screwing up! Especially right now because our shop has gotten alot of press as a cool store which drives traffic to our site and it's not ready! I use cc module and Table rates for shipping, so my cart is very straightforward. I have edited the appearance minimally - you can see it at Fusion Home. (Keep it simple stupid) I am running OsCommerce 2.2-MS2 through Lunarpages. I backed up some files, not all. (I thought running a backup was all I needed, didn't realize that just saved customers, products.) I have cc.php, cc_validation and maybe a couple more. I have originals I downloaded last night. But as you know, this is the second module I have tried installing for CVV so I have lots of edited pages. Thanks again, Cynthia |
| Sponsored Links | ||
| ||
| |
| Thread Tools | |
| |
| ||||
| Posted By | For | Type | Date | |
| V2: Blogs, Photos, Videos and more on Technorati | This thread | Refback | 06-13-2007 09:33 PM | |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error message | Paperman | osCommerce 2.2 Discussion | 1 | 11-04-2006 08:21 PM |
| Easypopulate Error message | fuzzyphil | osCMax v1.7 General Mods Discussion | 0 | 11-08-2005 04:43 PM |
| configure.php error message | webmissie1 | osCMax v2 Installation issues | 3 | 09-16-2005 07:22 AM |
| 1016 Error message PLEASE HELP!! | Lalla | osCommerce 2.2 Modification Help | 0 | 03-16-2004 04:14 PM |
| Help! Parse error message... | louis1st | osCommerce 2.2 Modification Help | 2 | 09-16-2003 02:18 AM |