osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

help please !!!

This is a discussion on help please !!! within the Authorize.net forums, part of the Payment Modules category; I just installed the Authorize.net moduel and while running it test mode I get this when it goes to confirmation. ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Features Discussion > Payment Modules > Authorize.net

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 11-30-2007, 10:47 AM
Lurker
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
nitroc
Exclamation help please !!!

I just installed the Authorize.net moduel and while running it test mode I get this when it goes to confirmation.
Warning: Missing argument 5 for validate() in /home/nitr/public_html/catalog/includes/classes/cc_validation.php on line 17

Warning: Cannot modify header information - headers already sent by (output started at /home/nitr/public_html/catalog/includes/classes/cc_validation.php:17) in /home/nitr/public_html/catalog/includes/functions/general.php on line 34

I don't know where to gpo from here. please let me know who I can solve this problem



Thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
  #2  
Old 11-30-2007, 10:57 AM
Member
 
Join Date: Feb 2007
Posts: 31
Thanks: 2
Thanked 2 Times in 2 Posts
Rep Power: 0
Autoegocrat is on a distinguished road
Default Re: help please !!!

Have you modified cc_validation.php at all?

Post its contents.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 11-30-2007, 11:40 AM
Lurker
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
nitroc
Default Re: help please !!!

hope this works

<?php
/*
$Id: cc_validation.php,v 1.2.2.1.2.2 2005/09/21 20:57:52 Michael Sasek Exp $

osCMax Power E-Commerce
osCommerce Documentation by OSCdox :: osCommerce and osCMax documentation

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;

// LINE MODIFIED: Added $cvv, $cr_card_type
function validate($number, $expiry_m, $expiry_y, $cvv, $cr_card_type) {
$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;
}
}

// BOF: MOD - CVV
$l = strlen($cvv);
if (strlen($cr_card_type) > 0 && ($this->cc_type != $cr_card_type)) {
return -5;
}

switch($cr_card_type) {
case 'American Express':
$len = 4;
break;
case 'Discover':
$len = 3;
break;
case 'Master Card':
$len = 3;
break;
case 'Visa':
$len = 3;
break;
}

if ($len != $l) {
return -6;
}
// EOF: MOD - CVV
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);
}
}
?>
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


All times are GMT -8. The time now is 07:19 PM.


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