osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Please help! Error message

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 ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack (1) Thread Tools
  1 links from elsewhere to this Post. Click to view. #1  
Old 06-13-2007, 02:10 PM
New Member
 
Join Date: Jun 2007
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
chobo10 is on a distinguished road
Exclamation Please help! Error message

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
  #2  
Old 06-13-2007, 04:28 PM
Active Member
 
Join Date: Oct 2005
Location: wherever I happen to be at the moment
Posts: 470
Thanks: 4
Thanked 79 Times in 73 Posts
Rep Power: 8
met00 is just really nicemet00 is just really nicemet00 is just really nicemet00 is just really nicemet00 is just really nice
Default Re: Please help! Error message

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to met00 For This Useful Post:
chobo10 (06-13-2007)
  #3  
Old 06-13-2007, 04:54 PM
osCMax Testing Team
 
Join Date: Sep 2004
Posts: 298
Thanks: 23
Thanked 35 Times in 34 Posts
Rep Power: 6
bkpie has a spectacular aura aboutbkpie has a spectacular aura about
Default Re: Please help! Error message

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 06-13-2007, 05:52 PM
New Member
 
Join Date: Jun 2007
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
chobo10 is on a distinguished road
Default Re: Please help! Error message

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 06-13-2007, 06:21 PM
osCMax Testing Team
 
Join Date: Sep 2004
Posts: 298
Thanks: 23
Thanked 35 Times in 34 Posts
Rep Power: 6
bkpie has a spectacular aura aboutbkpie has a spectacular aura about
Default Re: Please help! Error message

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 06-13-2007, 06:35 PM
New Member
 
Join Date: Jun 2007
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
chobo10 is on a distinguished road
Default Re: Please help! Error message

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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 06-13-2007, 08:51 PM
osCMax Testing Team
 
Join Date: Sep 2004
Posts: 298
Thanks: 23
Thanked 35 Times in 34 Posts
Rep Power: 6
bkpie has a spectacular aura aboutbkpie has a spectacular aura about
Default Re: Please help! Error message

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 06-14-2007, 11:50 AM
New Member
 
Join Date: Jun 2007
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
chobo10 is on a distinguished road
Default Re: Please help! Error message

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9  
Old 06-14-2007, 12:04 PM
osCMax Testing Team
 
Join Date: Sep 2004
Posts: 298
Thanks: 23
Thanked 35 Times in 34 Posts
Rep Power: 6
bkpie has a spectacular aura aboutbkpie has a spectacular aura about
Default Re: Please help! Error message

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. and what mods do you already have installed. Whew enough questions?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10  
Old 06-14-2007, 12:29 PM
New Member
 
Join Date: Jun 2007
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
chobo10 is on a distinguished road
Default Re: Please help! Error message

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.oscmax.com/forums/oscmax-v2-customization-mods/9386-please-help-error-message.html

Posted By For Type Date
V2: Blogs, Photos, Videos and more on Technorati This thread Refback 06-13-2007 09:33 PM

Similar Threads

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


All times are GMT -8. The time now is 02:27 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax