Jump to content
Sign in to follow this  
ramiav

cancel credit card validation

Recommended Posts

hi all

how do i turn off the credit card validation ,

im using the regular cc.php and i want whatever the customer type

to go thru.

does any1 can help me with that please?

Share this post


Link to post
Share on other sites
hi all

how do i turn off the credit card validation ,

im using the regular cc.php and i want whatever the customer type

to go thru.

does any1 can help me with that please?

the same here.. PLEASE TELL US...

Share this post


Link to post
Share on other sites
the same here.. PLEASE TELL US...

 

 

Again I am desperate to turn this of fully, I know we are lossing order through cards b eing declined I have tired a few things on the boards here but only found errors.

Anyone any idea please!

 

thanks

 

Zebra


Thanking God for a beautiful day??

Share this post


Link to post
Share on other sites

In includes/classes/cc_validation.php, there is a long if-else statement that has many different types of cards on there that it uses to validate the type of card being used.

 

You can easily add/remove cards as necessary, but I'm not sure about turning the whole thing off - you really accept every single type of credit card there is??

 

There's more information in this thread and to add more credit cards to the list check out this thread

Share this post


Link to post
Share on other sites

Edit catalog/includes/classes/cc_validation.php and around line 57 should read:

      return $this->is_valid();

Make is look like:

//      return $this->is_valid();
     return true;

and that should do the trick for you. ;)


"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Share this post


Link to post
Share on other sites

Hi, thanks for your post!

 

It's not a matter of accepting every card... we don't but the problem is that so many cards are being flagged up as not valid, since the operation is done manually at the other end its ok for us just to let all cards through.

Part of the problem is that I can't seem to keep up with the changes in the card numbers!

 

thanks

 

Peter


Thanking God for a beautiful day??

Share this post


Link to post
Share on other sites
Edit catalog/includes/classes/cc_validation.php and around line 57 should read:

 ? ? ?return $this->is_valid();

Make is look like:

// ? ? ?return $this->is_valid();
? ? ?return true;

and that should do the trick for you. ;)

 

Hi thanks so much!

 

I will give it a go right away and let you know how it goes

 

thanks

 

Peter


Thanking God for a beautiful day??

Share this post


Link to post
Share on other sites
Edit catalog/includes/classes/cc_validation.php and around line 57 should read:

 ? ? ?return $this->is_valid();

Make is look like:

// ? ? ?return $this->is_valid();
? ? ?return true;

and that should do the trick for you. ;)

 

Hi Jim thanks for your help that seems to have done it, and it still checks the card type.. just not the number.

Perfect!

 

thanks

 

Peter


Thanking God for a beautiful day??

Share this post


Link to post
Share on other sites
Hi Jim thanks for your help that seems to have done it, and it still checks the card type.. just not the number.

Perfect!

 

thanks

 

Peter

 

 

I tried entering this code and it still gives me the error. Someone said that I might be working with an older version of the ccvalidation file. Is that possibly messing me up? Where do I find the new one?

 

Here's My Code:

<?php

/*

$Id: cc_validation.php,v 1.3 2003/02/12 20:43:41 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright ? 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();

return true;

}

 

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 fantastic as i've been working on this for a couple days!!

 

 

 

oh and a ps -- i'm working with the authorize.net module.

Edited by apexonelove

Share this post


Link to post
Share on other sites

Hi Guys

 

I know this is an old post but I too am trying to get my eshop to accept any card numbers. The validation file that oscommerce installs add values for certain cards that are not applicable to the UK so I want the customer to be able to enter their card details and for it to be processed regardless of the card type.

 

I have tried using the above method of commenting doing the above:

 

// return $this->is_valid();

return true;

 

But when I try and enter a card number the system won't let me. I think it will only let me use the default CC number of 41111111111 but I can't seem to find where i can remove/stop it from doing this.

 

The site is on a live server but is there some setting that I need to activate to tell oscommerce that the system is live and to process payments?

 

Many thanks

 

Trev

Share this post


Link to post
Share on other sites

try editing cc_validation.php

 

Instead of making the change you post above try changing

	  } else {
	return -1;
  }

to

	  } else {
	$this->cc_type='Unknown Card';
  }

 

Tom

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×