Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit cards accepted


Daemonj

Recommended Posts

In the administration section, I have enabled Credit Cards for payment. Is there a way to specify which credit cards are accepted?

 

For example, my merchant account is only setup to process VISA, MC, and AMEX so I need a way to bounce customers back that try to use any other type of card (e.g. Discover).

"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

Link to comment
Share on other sites

  • 3 weeks later...

having same problem. Need something for visa, mastercard and discover only. Having alot of customers using credit cards I do not accept.

Link to comment
Share on other sites

*Please backup before trying any of the following*

 

You have to modify this file: cc_validation.php

found in this directory: catalog/includes/classes

 

If you only want to accept certain cards

you have to remove or comment out

(far better so you can easily add enable cards at a later date)

the lines which correspond to the cards.

 

The card types have names next to the line (VISA , mastercard)

 

The first line of my file reads:

 

if (ereg('^30[0-5]{1}[0-9]{1}([0-9]{10})?$', $this->cc_number)) {

       $this->cc_type = 'Diners Club';

 return -5;

 

subsequent lines read:

} elseif (ereg('^36[0-9]{2}([0-9]{10})?$', $this->cc_number)) {

       $this->cc_type = 'Diners Club';

 return -5;

     } elseif (ereg('^38[0-8]{1}[0-9]{1}([0-9]{10})?$', $this->cc_number)) {

       $this->cc_type = 'Diners Club';

 return -5;

     } elseif (ereg('^34[0-9]{2}([0-9]{11})?$', $this->cc_number)) {

       $this->cc_type = 'American Express';

 return -5;

     } elseif (ereg('^37[0-9]{2}([0-9]{11})?$', $this->cc_number)) {

       $this->cc_type = 'American Express';

 return -5;        

     } elseif (ereg('^5610([0-9]{12})?$', $this->cc_number)) {

       $this->cc_type = 'Australian Bankcard';

 return -5;

 

the final lines are:

 

} elseif (ereg('^4936[0-9]{2}([0-9]{10})?$', $this->cc_number)) {  

       $this->cc_type = 'UK Switch';  

       return ($numSum % 10 == 0); }

 

So what have we learnt:

The first card type code is of the form:

if ....;

 

then subsequent card types begin with :

elseif ... ;

 

the last card type has to have a } at the end of the code.

 

hope this was ok.

Special Effects / 3d + Flash

Link to comment
Share on other sites

I am using CC_CVV+UK Switch v1.0 from Barry McEwan

(because in the UK SWITCH is a very popular card.)

 

Also certain cards have multiple lines to cope with Credit Cards

with different length numbers.

 

So , say in the UK there are 3 lengths of numbers (12 digits , 16 digits and 19 digits) for a card called RAMESH.

 

This means in the cc_validation.php file there would be 3 sections of code corresponding to the 3 different lengths of card.

 

So check that your card(s) (ones you want to enable).

are listed in the cc_validation.php and keep all lines which refer to them.

 

Good Luck and reply in this forum for anything else !

Special Effects / 3d + Flash

Link to comment
Share on other sites

  • 6 months later...

I've just installed Barry McEwan's CC_CVV+UK Switch v1.0 and now all the cards are recognised properly but NOTHING is acepted!! :(

 

I've gone over the readme as carefully as possible and can't see any obvious problems.

 

HELP!

Calum Morrell

Link to comment
Share on other sites

*looks sheepish*

 

however the one thing I hadn't tried was stopping and restarting the cc payment module.

 

All seems well now, well with that anyway, there's an issue with the blacklist [admin module looking for fields that the readme doesn't tell me to create] but I'll get that sorted easily enough.

 

Thanks for a great contrib Barry :D

Calum Morrell

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...