Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can I keep customers from using american express


Recommended Posts

Posted
How can I keep customers from using american express, my customer doesnt accept that card, only visa and mastercard?

 

in catalog/includes/classes/cc_validation.php look for:

 

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;

}

 

 

and replace with:

 

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';

} else {

return -1;

}

Posted

Except that code will block any Maestro cards, which are issued by MasterCard.

 

Whether this is a problem or not will depend on whether Maestro cards are issued in your country and whether you are allowed to accept them. If you are in the UK it would be a major issue - they account for about 10% of our sales.

 

If MasterCard or Visa issue any cards that fail those checks, you will be rejecting them.

 

I allow all valid credit card numbers through the validation. Sometimes people will pay by American Express which I can't accept, but the hastle from these orders is better than losing orders due to a valid card number being rejected.

 

Jon.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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