Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit cards not being accepted


Guest

Recommended Posts

Hey guys,

I know this question has been asked many times through the forum.. But im still a little bit confused with the credit card module.

I see in cc_validation.php it has listed the accepted 4 first digits and then allocates it to the correct type of card may it be ( mastercard, visa .. or whatever ) but I do not want this checking. I just want it to accept all card numbers because i manually process the order.

I have made these changes in cc_validation.php but still not working.. can someone help me.. i think i screwed sumfin up..

 

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;

}

 

 

i thought :

} else {

return -1;

}

makes it accept any card.. hrmmm well it sure didnt work still.. its still fussy when it comes to accepting the right kinda card...

 

looking for a quick easy fix..

 

come on php guys.. help me out

 

 

ta

 

 

grego

Link to comment
Share on other sites

Hey guys,

I know this question has been asked many times through the forum.. But im still a little bit confused with the credit card module.

I see in cc_validation.php it has listed the accepted 4 first digits and then allocates it to the correct type of card may it be ( mastercard, visa .. or whatever ) but I do not want this checking. I just want it to accept all card numbers because i manually process the order.

I have made these changes in cc_validation.php but still not working.. can someone help me.. i think i screwed sumfin up..

 

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;

      }

i thought :

} else {

        return -1;

      }

makes it accept any card.. hrmmm well it sure didnt work still.. its still fussy when it comes to accepting the right kinda card...

 

looking for a quick easy fix..

 

come on php guys.. help me out

ta

grego

 

try return 1;

Treasurer MFC

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...