Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Card error doesn't appear, and expiry date doesn't work


daz_75

Recommended Posts

hi,

 

I don't know anything about php so maybe some can help.

 

My friend installed a CVV2 and switch contrib for me, but i've noticed it's not working correctly and he's busy.

 

When i checkout i can put any expiration date i want into the drop down menu and it won't error even if that date has expired.

 

Also, when i put in an incorrect credit card number it comes up with "Credit Card Error!" but that's it. In the URL though you can see the error that it's supposed to print on screen

"The first four digits of the number entered are: 1111 If that number is correct, we do not accept that type of credit card. If it is wrong, please try again"

 

My website is www.chapelradiocontrol.com/shop

 

Im guessin the problem lies in includes/modules/payment/cc.php so here is the output from that, if anyone can help i would much apprciate it

 

Thanks

 

Daz

 

<?php

/*

$Id: cc.php,v 1.53 2003/02/04 09:55:01 project3000 Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

class cc {

var $code, $title, $description, $enabled;

 

// class constructor

function cc() {

global $order;

 

$this->code = 'cc';

$this->title = MODULE_PAYMENT_CC_TEXT_TITLE;

$this->description = MODULE_PAYMENT_CC_TEXT_DESCRIPTION;

$this->sort_order = MODULE_PAYMENT_CC_SORT_ORDER;

$this->enabled = ((MODULE_PAYMENT_CC_STATUS == 'True') ? true : false);

 

if ((int)MODULE_PAYMENT_CC_ORDER_STATUS_ID > 0) {

$this->order_status = MODULE_PAYMENT_CC_ORDER_STATUS_ID;

}

 

if (is_object($order)) $this->update_status();

}

 

// class methods

function update_status() {

global $order;

 

if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_CC_ZONE > 0) ) {

$check_flag = false;

$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_CC_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");

while ($check = tep_db_fetch_array($check_query)) {

if ($check['zone_id'] < 1) {

$check_flag = true;

break;

} elseif ($check['zone_id'] == $order->billing['zone_id']) {

$check_flag = true;

break;

}

}

 

if ($check_flag == false) {

$this->enabled = false;

}

}

}

 

// begin cvv contribution

function javascript_validation() {

$js = ' if (payment_value == "' . $this->code . '") {' . "\n" .

' var cc_owner = document.checkout_payment.cc_owner.value;' . "\n" .

' var cc_number = document.checkout_payment.cc_number.value;' . "\n" .

' var cvvnumber = document.checkout_payment.cvvnumber.value;' . "\n" .

' if (cc_owner == "" || cc_owner.length < ' . CC_OWNER_MIN_LENGTH . ') {' . "\n" .

' error_message = error_message + "' . MODULE_PAYMENT_CC_TEXT_JS_CC_OWNER . '";' . "\n" .

' error = 1;' . "\n" .

' }' . "\n" .

' if (cc_number == "" || cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" .

' error_message = error_message + "' . MODULE_PAYMENT_CC_TEXT_JS_CC_NUMBER . '";' . "\n" .

' error = 1;' . "\n" .

' }' . "\n" .

' if (cvvnumber.length > ' . CVVNUMBER_MAX_LENGTH . ') {' . "\n" .

' error_message = error_message + "' . MODULE_PAYMENT_CC_TEXT_JS_MAXCVVNUMBER . '";' . "\n" .

' error = 1;' . "\n" .

' }' . "\n" .

' if (cvvnumber == ""|| cvvnumber.length < ' . CVVNUMBER_MIN_LENGTH . ') {' . "\n" .

' error_message = error_message + "' . MODULE_PAYMENT_CC_TEXT_JS_CVVNUMBER . '";' . "\n" .

' error = 1;' . "\n" .

' }' . "\n" .

' }' . "\n";

 

return $js;

}

// end cvv contribution

 

 

 

 

function selection() {

global $order;

 

for ($i=1; $i<13; $i++) {

$expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));

}

 

$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)));

}

 

 

for ($i=1; $i < 13; $i++) {

$start_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));

}

 

$today = getdate();

for ($i=$today['year']-4; $i <= $today['year']; $i++) {

$start_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));

}

 

 

 

/*

$selection = array('id' => $this->code,

'module' => $this->title,

'fields' => array(array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER,

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

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER,

'field' => tep_draw_input_field('cc_number')),

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,

'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)),

// begin cvv contribution

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_CVVNUMBER . ' ' .'<a href="java script:popupWindow(\'' . tep_href_link(FILENAME_POPUP_CVV, '', 'SSL') . '\')">' . TEXT_CVV_LINK . '</a>',

'field' => tep_draw_input_field('cvvnumber'))));

// end cvv contribution

*/

 

 

 

 

$si_fields[] = array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER,

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

array_push ($si_fields, array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER,

'field' => tep_draw_input_field('cc_number')));

if ( USE_CC_CVV == 'true' || USE_CC_ISSUE == 'true' ) {

array_push ($si_fields, array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_START,

'field' => tep_draw_pull_down_menu('cc_start_month', $start_month) . ' ' . tep_draw_pull_down_menu('cc_start_year', $start_year)));

}

array_push ($si_fields, array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,

'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)));

array_push ($si_fields, array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_CVVNUMBER . ' ' .'<a href="java script:popupWindow(\'' . tep_href_link(FILENAME_POPUP_CVV, '', 'SSL') . '\')">' . TEXT_CVV_LINK . '</a>',

'field' => tep_draw_input_field('cvvnumber')));

if ( USE_CC_ISSUE == 'true' ) {

array_push ($si_fields, array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_ISSUE_NUMBER . MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_ISSUE_NOTE . ' ',

'field' => tep_draw_input_field('cc_issue')));

}

if ( USE_CC_ISSUE == 'true' ) {

array_push ($si_fields, array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_ISSUE_TEXT ,

'field' => ''));

}

 

 

$selection = array('id' => $this->code,

'module' => $this->title,

'fields' => $si_fields);

 

return $selection;

}

 

function pre_confirmation_check() {

global $HTTP_POST_VARS;

 

include(DIR_WS_CLASSES . 'cc_validation.php');

// begin cvv contribution

$cc_validation = new cc_validation();

 

//$result = $cc_validation->validate($HTTP_POST_VARS['cc_number'], $HTTP_POST_VARS['cc_expires_month'], $HTTP_POST_VARS['cc_expires_year'], $HTTP_POST_VARS['cvvnumber']);

 

$result = $cc_validation->validate($HTTP_POST_VARS['cc_number'], $HTTP_POST_VARS['cc_expires_month'], $HTTP_POST_VARS['cc_expires_year'], $HTTP_POST_VARS['cc_start_month'], $HTTP_POST_VARS['cc_start_year'], $HTTP_POST_VARS['cvvnumber'], $HTTP_POST_VARS['cc_issue']);

 

// end cvv contribution

$error = '';

switch ($result) {

case -1:

$error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));

break;

case -2:

case -3:

case -4:

$error = TEXT_CCVAL_ERROR_INVALID_DATE;

break;

//**si**

case -5:

$error = sprintf(TEXT_CCVAL_ERROR_DONOT_ACCEPT, $cc_validation->cc_type);

break;

case -6:

$error = TEXT_CCVAL_ERROR_INVALID_START_DATE;

break;

case -11:

$error = MODULE_PAYMENT_CC_TEXT_ISSUE_ERR;

break;

case -12:

$error = MODULE_PAYMENT_CC_TEXT_CVV_ERR;

break;

//**si** end

case false:

$error = TEXT_CCVAL_ERROR_INVALID_NUMBER;

break;

}

 

if ( ($result == false) || ($result < 1) ) {

//$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($HTTP_POST_VARS['cc_owner']) . '&cc_expires_month=' . $HTTP_POST_VARS['cc_expires_month'] . '&cc_expires_year=' . $HTTP_POST_VARS['cc_expires_year'];

$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($HTTP_POST_VARS['cc_owner']) . '&cc_expires_month=' . $HTTP_POST_VARS['cc_expires_month'] . '&cc_expires_year=' . $HTTP_POST_VARS['cc_expires_year'] . '&cc_start_month=' . $HTTP_POST_VARS['cc_start_month'] . '&cc_start_year=' . $HTTP_POST_VARS['cc_start_year'];

 

 

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));

}

 

$this->cc_card_type = $cc_validation->cc_type;

$this->cc_card_number = $cc_validation->cc_number;

}

 

function confirmation() {

global $HTTP_POST_VARS;

 

/*

$confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,

'fields' => array(array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER,

'field' => $HTTP_POST_VARS['cc_owner']),

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER,

'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,

'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year']))),

// begin cvv contribution

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_CVVNUMBER,

'field' => $HTTP_POST_VARS['cvvnumber'])));

// end cvv contribution

 

*/

 

 

if ($HTTP_POST_VARS['cc_start_year'] > 80) {

$start_y = '19' . $HTTP_POST_VARS['cc_start_year'];

} else {

$start_y = '20' . $HTTP_POST_VARS['cc_start_year'];

}

$confirmation = array('title' => $this->title . ': ' . $this->cc_card_type,

'fields' => array(array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER,

'field' => $HTTP_POST_VARS['cc_owner']),

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER,

'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_START,

'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_start_month'], 1, $start_y))),

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,

'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . $HTTP_POST_VARS['cc_expires_year']))),

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_CVVNUMBER,

'field' => $HTTP_POST_VARS['cvvnumber']),

array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_ISSUE_NUMBER,

'field' => $HTTP_POST_VARS['cc_issue']),

));

 

return $confirmation;

}

 

function process_button() {

global $HTTP_POST_VARS;

 

 

$process_button_string = tep_draw_hidden_field('cc_owner', $HTTP_POST_VARS['cc_owner']) .

tep_draw_hidden_field('cc_start', $HTTP_POST_VARS['cc_start_month'] . $HTTP_POST_VARS['cc_start_year']) .

tep_draw_hidden_field('cc_expires', $HTTP_POST_VARS['cc_expires_month'] . $HTTP_POST_VARS['cc_expires_year']) .

tep_draw_hidden_field('cc_type', $this->cc_card_type) .

tep_draw_hidden_field('cc_number', $this->cc_card_number).

tep_draw_hidden_field('cvvnumber', $HTTP_POST_VARS['cvvnumber']).

tep_draw_hidden_field('cc_issue', $HTTP_POST_VARS['cc_issue']);

 

 

return $process_button_string;

}

 

function before_process() {

global $HTTP_POST_VARS, $order;

 

if ( (defined('MODULE_PAYMENT_CC_EMAIL')) && (tep_validate_email(MODULE_PAYMENT_CC_EMAIL)) ) {

$len = strlen($HTTP_POST_VARS['cc_number']);

 

$this->cc_middle = substr($HTTP_POST_VARS['cc_number'], 4, ($len-8));

$order->info['cc_number'] = substr($HTTP_POST_VARS['cc_number'], 0, 4) . str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . substr($HTTP_POST_VARS['cc_number'], -4);

}

}

 

function after_process() {

global $insert_id;

 

if ( (defined('MODULE_PAYMENT_CC_EMAIL')) && (tep_validate_email(MODULE_PAYMENT_CC_EMAIL)) ) {

$message = 'Order #' . $insert_id . "\n\n" . 'Middle: ' . $this->cc_middle . "\n\n";

 

tep_mail('', MODULE_PAYMENT_CC_EMAIL, 'Extra Order Info: #' . $insert_id, $message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

}

}

 

function get_error() {

global $HTTP_GET_VARS;

 

$error = array('title' => MODULE_PAYMENT_CC_TEXT_ERROR,

'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));

 

return $error;

}

 

function check() {

if (!isset($this->_check)) {

$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_CC_STATUS'");

$this->_check = tep_db_num_rows($check_query);

}

return $this->_check;

}

 

function install() {

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Credit Card Module', 'MODULE_PAYMENT_CC_STATUS', 'True', 'Do you want to accept credit card payments?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Split Credit Card E-Mail Address', 'MODULE_PAYMENT_CC_EMAIL', '', 'If an e-mail address is entered, the middle digits of the credit card number will be sent to the e-mail address (the outside digits are stored in the database with the middle digits censored)', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_CC_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0' , now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_CC_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_CC_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");

 

//**si**

//--

//-- The following will create the new configuration keys and turn on all required

//-- checks to run the new credit card validation. To use the original cc validation

//-- please swap **ALL** of the configuration_value's true->false and false->true

//--

 

 

 

//--

//-- new processing

//--

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept DELTA cards', 'MODULE_PAYMENT_CC_ACCEPT_DELTA', 'true', 'Accept DELTA credit cards', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept Electron cards', 'MODULE_PAYMENT_CC_ACCEPT_ELECTRON', 'true', 'Accept ELECTRON credit cards', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept VISA cards', 'MODULE_PAYMENT_CC_ACCEPT_VISA', 'true', 'Accept VISA credit cards', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept MASTERCARD cards', 'MODULE_PAYMENT_CC_ACCEPT_MASTERCARD', 'true', 'Accept MASTERCARD credit cards', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept SWITCH cards', 'MODULE_PAYMENT_CC_ACCEPT_SWITCH', 'true', 'Accept SWITCH credit cards', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept SOLO cards', 'MODULE_PAYMENT_CC_ACCEPT_SOLO', 'true', 'Accept SOLO credit cards', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept MAESTRO cards', 'MODULE_PAYMENT_CC_ACCEPT_MAESTRO', 'true', 'Accept MAESTRO credit cards', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept JCB cards', 'MODULE_PAYMENT_CC_ACCEPT_JCB', 'true', 'Accept JCB credit cards', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

//--

//--std processing

//--

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept Orig JCB cards', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_JCB', 'false', 'Accept JCB credit cards via original checks', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept Orig VISA cards', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_VISA', 'false', 'Accept Visa credit cards via original checks', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept Orig DINERSCLUB cards', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_DINERSCLUB', 'false', 'Accept DINERSCLUB credit cards via original checks', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept Orig AMEX cards', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_AMERICANEXPRESS', 'false', 'Accept AMERICAN EXPRESS credit cards via original checks', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept Orig CARTE BLANCHE cards', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_CARTBLANCHE', 'false', 'Accept CARTE BLANCHE credit cards via original checks', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept Orig MASTERCARD cards', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_MASTERCARD', 'false', 'Accept MASTERCARD credit cards via original checks', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept Orig AUSTRALIAN BANKCARD cards', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_OZBANKCARD', 'false', 'Accept AUSTRALIAN BANKCARD cards via original checks', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Accept Orig DISCOVER/NOVUS cards', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_DISCOVERNOVUS', 'false', 'Accept DISCOVER/NOVUS credit cards via original checks', 6, 0, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),')");

 

//**si** end

 

 

}

 

function remove() {

tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

}

 

function keys() {

// return array('MODULE_PAYMENT_CC_STATUS', 'MODULE_PAYMENT_CC_EMAIL', 'MODULE_PAYMENT_CC_ZONE', 'MODULE_PAYMENT_CC_ORDER_STATUS_ID', 'MODULE_PAYMENT_CC_SORT_ORDER');

 

return array('MODULE_PAYMENT_CC_STATUS', 'MODULE_PAYMENT_CC_EMAIL', 'MODULE_PAYMENT_CC_ZONE', 'MODULE_PAYMENT_CC_ORDER_STATUS_ID', 'MODULE_PAYMENT_CC_SORT_ORDER',

// now add the new paymeny checks

'MODULE_PAYMENT_CC_ACCEPT_DELTA', 'MODULE_PAYMENT_CC_ACCEPT_ELECTRON', 'MODULE_PAYMENT_CC_ACCEPT_VISA', 'MODULE_PAYMENT_CC_ACCEPT_MASTERCARD',

'MODULE_PAYMENT_CC_ACCEPT_SWITCH', 'MODULE_PAYMENT_CC_ACCEPT_SOLO', 'MODULE_PAYMENT_CC_ACCEPT_JCB', 'MODULE_PAYMENT_CC_ACCEPT_MAESTRO',

'MODULE_PAYMENT_CC_ACCEPT_ORIG_VISA', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_DINERSCLUB', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_AMERICANEXPRESS',

'MODULE_PAYMENT_CC_ACCEPT_ORIG_JCB', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_CARTBLANCHE', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_MASTERCARD',

'MODULE_PAYMENT_CC_ACCEPT_ORIG_OZBANKCARD', 'MODULE_PAYMENT_CC_ACCEPT_ORIG_DISCOVERNOVUS'

);

 

 

}

}

?>

Link to comment
Share on other sites

Also, should there be a credit card option in the admin module section?

Well, if you are processing CC payments, you should be using a payment gateway to process this.

The simplest is PayPal (there is a multitude of modules that you can installl, find ou what suits you).

Let the payment gateway take care of the CC verification.

Link to comment
Share on other sites

  • 1 month later...

I'm having the same problem - I can type in ANY number and ANY expiry (even one that has already been, eg January 2006) and the card it processed. I've checked both includes/modules/payment/cc.php and includes/classes/cc_validation and both are identical to the files that came with oscommerce (I have commented out some of the statements about which cards are accepted in cc_validation.php). I'm really kinda stuck, I'm guessing it's a contribution I've added, but I don't know where or what is doing this. Any advice gratefully accepted :)

 

~bobsi18~

Link to comment
Share on other sites

I'm having the same problem - I can type in ANY number and ANY expiry (even one that has already been, eg January 2006) and the card it processed. I've checked both includes/modules/payment/cc.php and includes/classes/cc_validation and both are identical to the files that came with oscommerce (I have commented out some of the statements about which cards are accepted in cc_validation.php). I'm really kinda stuck, I'm guessing it's a contribution I've added, but I don't know where or what is doing this. Any advice gratefully accepted :)

 

~bobsi18~

 

Ok, update. I have the points/rewards module installed, and when the total is greater thanthe minimum needed to activate the points, the validation works. I'll keep working on it...

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