Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Modifying default CC module


Guest

Recommended Posts

Posted

I apologize if this may have been answered already but I didn't find anything on the boards when I searched.

 

I want to only accept Visa and MasterCard in osCommerce's default credit card module, I know that the system recognizes the type of card by the first 4 digits.

 

What file do I need to change so that it will only accept Visa and Mastercard and what code do I need to change?

 

Thanks in advance for your assistance.

Posted

You could do a couple of things. First, and easiest, would be to just modify your cc.php to actually tell customers you only accept MC and Visa. If it's clear customers will likely only try to use MC and Visa, and if they don't you won't be able to accept their payment via your terminal so you could just send them an email back saying it was invalid, we only accept MC and Visa, etc.

 

Second, you can just add a drop down box for people to select CC type and only include MC and Visa as options, such as

 

in cc.php :

 

after this :

$today = getdate();
for ($i=$today['year']; $i < $today['year']+10; $i++) {
$expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
}

 

add this :

 

$cards_array[] = array('id' => '1','text' => 'MasterCard');
$cards_array[] = array('id' => '2','text' => 'Visa Card');

 

after this:

 

'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),

 

add this :

 

array('title' => 'Card Type',
'field' => tep_draw_pull_down_menu('cards', $cards_array, $default = '1')),

 

Third, there is a contribution that could do what your ask:

 

http://www.oscommerce.com/community/contributions,1148

Posted
You could do a couple of things.  First, and easiest, would be to just modify your cc.php to actually tell customers you only accept MC and Visa.  If it's clear customers will likely only try to use MC and Visa, and if they don't you won't be able to accept their payment via your terminal so you could just send them an email back saying it was invalid, we only accept MC and Visa, etc. 

 

Second, you can just add a drop down box for people to select CC type and only include MC and Visa as options, such as

 

in cc.php :

 

after this :

$today = getdate();
for ($i=$today['year']; $i < $today['year']+10; $i++) {
$expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
}

 

add this :

 

$cards_array[] = array('id' => '1','text' => 'MasterCard');
$cards_array[] = array('id' => '2','text' => 'Visa Card');

 

after this:

 

'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),

 

add this :

 

array('title' => 'Card Type',
'field' => tep_draw_pull_down_menu('cards', $cards_array, $default = '1')),

 

Third, there is a contribution that could do what your ask:

 

http://www.oscommerce.com/community/contributions,1148

 

 

Thank for the advise, I will try your suggestion and see if it works.

Posted
after this:

 

'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),

 

add this :

 

array('title' => 'Card Type',
'field' => tep_draw_pull_down_menu('cards', $cards_array, $default = '1')),

 

 

I guess that the person that installed my store had modified the cc.php file because I don't have the section you indicated above in my file so I couldn't get it to work.

Archived

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

×
×
  • Create New...