Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

While trying to do a test order....


Orphon

Recommended Posts

Posted

through authorize.net

 

I get this error

 

Credit Card Error!

The first four digits of the number entered are:

If that number is correct, we do not accept that type of credit card.

If it is wrong, please try again.

 

any idea what it is doing wrong?

Angela

Posted

The cc_validation code is what's returning the error, not Authorize.net

 

What type of card are you trying to use?

 

Are you certain that the card number is a valid number for that type of card?

If you know for sure that it's a valid number, you will need to add it to the validation script

"The price of success is perseverance. The price of failure comes much cheaper."

Posted

yes, I have tried it with the test number 4111111111111111

 

also with authorize.net in test mode I have tried a real MasterCard credit card

 

what do I need to change? I would think Visa, MasterCard, American Express, and Discover would be set up in there already?

Angela

Posted

I have looked through admin and can't see anything related to this...

 

I guess it must be a differnt file...

 

Can someone tell me what file and what exactly I need to change?

 

I accept Visa, MasterCard, American Express and Discover...

 

Also, the module for authorize has a button for either Credit caard OR echeck... anyway to make it do both?

 

I hope someone can help

Angela

Posted

catalog/includes/classes/cc_validation.php

is the file you need to check for credit card validation routeens.

 

you may find that it is not totally up to date, with it's ereg checks for certain cards.. ive had problem with it rejecting valid cards as well.

 

re: I accept Visa, MasterCard, American Express and Discover...

(these all seem to be o.k for me though)

 

It's mainly Switch & Solo cards i had problems with..

 

Hope this helps :wink:

Posted

This is the code I have... I don't yet see what could be the problem....

 

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

   }

 }

?>

 

ANY help would be appreciated!

Angela

Posted

This whole thing still puzzles me. Looking at this code I can't for the life of me figure out what would be causeing the cards to be declined....

 

Any help would greatly be appreciated....

Angela

Posted

I should add that I haven't played with the actual cart yet... I want to get credit cards to work.... altho I am thinking I might start working on in

Angela

Posted

Angela,

 

I just placed a test order using the Credit card module....went through without a hitch.

 

Uh...silly question....do you have a merchant account set up to use with AuthorizeNet? Or to process offline for that matter?

Posted
Angela,

 

I just placed a test order using the Credit card module....went through without a hitch.

 

Uh...silly question....do you have a merchant account set up to use with AuthorizeNet? Or to process offline for that matter?

 

Yes the Credit card module goes fine.... Which I can use for now and go to the virtual terminal and input it by hand.

 

I would like it to be live and automatic.

 

I do have an Authorize.net acct with a merchant acct.... I have auth set up in the moduals, with my username and key.... I can't figure out why it keeps saying the numbers are invalid or whatever...

Angela

Posted

Take a look through some of the other forums...I think AuthorizeNet made a change and the module needs a fix or something.

Posted

that may be... but someone said that was an error from OSC and not Authorize.net... so I am not sure what I should do...

 

I would REALLY like to get this working and I am not much of a programer, so I can't really tell if I need to change something in that code I posted earlier...

Angela

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...