Guest Posted September 23, 2005 Posted September 23, 2005 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.
jasper98 Posted September 23, 2005 Posted September 23, 2005 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
Guest Posted September 23, 2005 Posted September 23, 2005 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 <{POST_SNAPBACK}> Thank for the advise, I will try your suggestion and see if it works.
Guest Posted September 25, 2005 Posted September 25, 2005 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.