Jump to content
Sign in to follow this  
bmcewan

[Contribution] CC_CVV_start date plus credit card blacklist

Recommended Posts

Hmmm. can't see that would work at all ... (tried it just in case ...and it doesn't) because:

 

<tr>
               <td class="main" colspan="4"><?php echo $confirmation['title']; ?></td>
             </tr>

 

Prints the title 'Payment Information'

 

and then this bit:

 

<tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo $confirmation['fields'][$i]['title']; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo $confirmation['fields'][$i]['field']; ?></td>
             </tr>

 

cycles through a 'for' loop printing out all of the items below the title (such as card owner/card number/card date...) so replacing the 'title' code with a(nother) copy of part of the 'for' loop code as you suggest will achieve nothing but a very jumbled box of text ... which is what it does do...

 

:blink:

Share this post


Link to post
Share on other sites

Got it working on my site:

 

Replace this code:

 

About Line 269

 

<td class="main" colspan="4"><?php echo $confirmation['title']; ?></td>

 

With this code:

 

<td width="10"><td class="main"><?php echo $confirmation['title']; ?></td><td colspan="2"></td>

 

Hope that works.

 

Jez


Just embarked upon the greatest journey of my life........

Share this post


Link to post
Share on other sites
Would it be difficult to add Issue Number with the right forms of verification checks in place depending on the type of CC number to tell the customer that Issue Number is needed if he continues without typing the issue number in.

 

If anyone is up to coding it into the contribution, I have a list of all the current UK debit card (Switch, Solo, Delta, Electron) codes written as a series of 'If - then - else' statements (well, it's actually a function written in ASP, but it's easy to read...) which could be used in the contribution to decide if a card needs the 'issue' field filling in - apart from that one point this is an excellent contribution... haven't managed to break it yet one little bit ...

 

 

:rolleyes:

Share this post


Link to post
Share on other sites

Ooops ... forget to say why ... it's because not all UK debit cards have an issue number, so you can't just require that an issue number is entered by the customer on the basis that the card is a debit card (ie. some customers wont have an issue number on their debit card). You have to check each debit card number to see what the issuing bank is. The list (code) I mentioned is one that's used currently by an online gateway, and does that.

Edited by Pixxi

Share this post


Link to post
Share on other sites

well what i was thinking was that there could be a drop down list, where you choose your credit card type.

 

Then depending on what you select it requires you to fill in the issue number. You could keep the cc_validation as it is, as this code be a simple javascript.

 

That was my idea anyway, if i can be done or not i dont know.


Just embarked upon the greatest journey of my life........

Share this post


Link to post
Share on other sites

But ... (as I said in my post above) not all UK debit cards have issue numbers, so you can't pin it down to a particular card type when requiring an issue number. For example, (apparently...) UK Switch cards with 16 digits don't have issue numbers; whereas those with 19 digits do. Switch cards beginning with '6759...' sometimes have one, sometimes not. The situation is different again with Delta. So - it would seem - the only reliable way to see if an issue number is required would be to check the card number.

 

:rolleyes:

Share this post


Link to post
Share on other sites

Yes, that would be difficult to do.

 

One little thing, is there a way for the cc#, cvv, issue# text-boxes to only accept numbers not letters?


Just embarked upon the greatest journey of my life........

Share this post


Link to post
Share on other sites

You can strip the non-numerics from the card number using the snippet of code I posted earlier in this thread (in cc_validation.php):

 

// Remove any non numeric characters.
 function cleancc($number) {
 return ereg_replace('[^0-9]', '', $number);
 }	
   
   function validate($number, $expiry_m, $expiry_y) {
     // Removed by Dee
     //$this->cc_number = $number;
     
     // Added by Dee
       $this->cc_number = ereg_replace('[^0-9]', '', $number);
       $Number = ereg_replace('[^0-9]', '', $number);
    // End added by Dee


//  could not get the strip non numerics to work but left the function in and commented out the function call
//	$Number = cc_validation::cleancc($number);	
 
   // Removed by Dee
// $Number = $number;
// End removed by Dee

 

I agree, it would be helpful to trap for non-numerics in the isse number and CVV number as well - I know people will usually try to put numbers in, but they may mis-type and get a punctuation character or letter, and it's annoying for them/refects badly on the site if you have to telephone them.

I spent a couple of hours today trying to work out how to trap for non-numerics by putting some code into cc_validation.php just before the point where it checks the expiry date, but got stuck on which variable(s) to use: - 'cc_ccv' and 'cc_issue' don't seem to work, neither do this->cc_ccv or this->cc_issue - all give errors (perhaps because they don't have anything in them at that point?).

 

If anyone can solve that one it would be very useful and the last little bit (well, maybe apart from validating which debit cards require issue numbers...:dreams:) of the icing on the cake for this excellent contribution.

 

BTW, found a (partial) solution to the problem of lining up the 'Credit/Debit Card:Visa' text with the text below it on the checkout page:

 

in checkout.php, change this:

 

                <td class="main" colspan="4"><?php echo $confirmation['title']; ?></td>
             </tr>

 

to this:

 

<td width="0"><?php echo tep_draw_separator('pixel_trans.gif', '0', '0'); ?></td> <!-- added by DE to line up text -->
               <td class="main" colspan="4"><?php echo $confirmation['title']; ?></td>
             </tr>

 

Although this only lines up the 'Credit...' part ... still need to find a way to add something to this (in cc.php):

 

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

 

to space/align the name of the card (eg. 'Visa') with the text below it.

 

Anyone...?

 

TIA

 

 

:rolleyes:

Share this post


Link to post
Share on other sites
Leave it at 3, you will need to change the CVV field to accept 4 characters.

In catalog>includes>modules>payments>cc.php

On about line 124 or 125 you should something like

'field' => tep_draw_input_field('cc_cvv', '', 'size=3 maxlength=3'))));

 

Change the number from 3 to 4

 

This only makes the text box larger the validation still does not allow you to enter 4 digits.

 

Anyone got a fix for the problem yet?

Share this post


Link to post
Share on other sites

You need to change both of the number '3's to '4's (one determines the width of the box, the other the maximum no of digits) , eg:

 

'field' => tep_draw_input_field('cc_cvv', '', 'size=4 maxlength=4')),

 

and do it for each occasion it appears in cc.php - in my cc.php it appears 7 times:

 

Catalog:includes:modules:payment:cc.php"; Line 137:

Catalog:includes:modules:payment:cc.php"; Line 153:

Catalog:includes:modules:payment:cc.php"; Line 169:

Catalog:includes:modules:payment:cc.php"; Line 186:

Catalog:includes:modules:payment:cc.php"; Line 202:

Catalog:includes:modules:payment:cc.php"; Line 219:

Catalog:includes:modules:payment:cc.php"; Line 235:

 

Are you doing that?

 

:rolleyes:

Share this post


Link to post
Share on other sites

Hi Dee

 

I cant find those other 7 entries at all :(

 

<?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 (c) 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();
   }

// BMC Changes Start
// if cvv not enabled fill cc_cvv with 000
function ch_cvv() {
 if ( USE_CC_CVV != 'true' ) {
 $cc_cvv = '000';
 return $cc_cvv;
 }
}
// BMC Changes End  

// 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;
       }
     }
   }

   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 cc_cvv = document.checkout_payment.cc_cvv.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 (cc_cvv == "" || cc_cvv.length != ' . CC_CVV_MIN_LENGTH . ') {' . "\n" .
	 '    error_message = error_message + "' . MODULE_PAYMENT_CC_TEXT_JS_CC_CVV . '";' . "\n" .
	 '    error = 1;' . "\n" .
	 '  }' . "\n" . 	 
           '  }' . "\n";

     return $js;
   }

   function selection() {
     global $order;
// BMC for expiry date
     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)));
     }
// BMC Changes Start
// for start date
     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)));
     }   
// BMC Changes End   

     $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')),
// BMC Changes Start
            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)),
// BMC Changes End
                                          array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,
// BMC Changes Start
                                                'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)),
            array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_CVV,
               'field' => tep_draw_input_field('cc_cvv', '', 'size=4 maxlength=4')),
            array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_ISSUE,
               'field' => tep_draw_input_field('cc_issue', '', 'size=1 maxlength=1'))));
// BMC Changes End
     return $selection;
   }

   function pre_confirmation_check() {
     global $HTTP_POST_VARS;

     include(DIR_WS_CLASSES . 'cc_validation.php');

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

     $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;
// BMC Changes Start
 case -5:
   $error = sprintf(TEXT_CCVAL_ERROR_NOT_ACCEPTED, substr($cc_validation->cc_type, 0, 10), substr($cc_validation->cc_type, 0, 10));
   break;
 case -6:
         $error = TEXT_CCVAL_ERROR_SHORT;
         break;
 case -7:
   $error = TEXT_CCVAL_ERROR_BLACKLIST;
   break;      
// BMC Changes 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'];

       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)),
// BMC Changes Start
            array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_START, 
                           'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['cc_start_month'],1,$HTTP_POST_VARS['cc_start_year']))),                                              
            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_CVV,
            	 'field' => $HTTP_POST_VARS['cc_cvv']),
            array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_ISSUE,
            	 'field' => $HTTP_POST_VARS['cc_issue'])));
// BMC Changes End
     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_expires', $HTTP_POST_VARS['cc_expires_month'] . $HTTP_POST_VARS['cc_expires_year']) .
// BMC Changes Start
         tep_draw_hidden_field('cc_start', $HTTP_POST_VARS['cc_start_month'] . $HTTP_POST_VARS['cc_start_year']) .
         tep_draw_hidden_field('cc_cvv', $HTTP_POST_VARS['cc_cvv']) .
         tep_draw_hidden_field('cc_issue', $HTTP_POST_VARS['cc_issue']) .
// BMC Changes End
                              tep_draw_hidden_field('cc_type', $this->cc_card_type) .
                              tep_draw_hidden_field('cc_number', $this->cc_card_number);

     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);
// BMC Changes Start
     $this->cc_cvv = $HTTP_POST_VARS['cc_cvv'];
 $this->cc_start = $HTTP_POST_VARS['cc_start'];
 $this->cc_issue = $HTTP_POST_VARS['cc_issue'];
// BMC Changes End        
  }
   }

   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" . 
 'CVV:' . $this->cc_cvv . "\n\n" . 'Start:' . $this->cc_start . "\n\n" . 
 'ISSUE:' . $this->cc_issue . "\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() {
// BMC Changes Start
     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  Card Module', 'MODULE_PAYMENT_CC_STATUS', 'True', 'Do you want to accept  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, set_function, date_added) values ('Encrypt CC Info', 'CC_ENC', 'True', 'Do you want to encypt cc info?', '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 ('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())");   
  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 ('Collect CVV Number', 'USE_CC_CVV', 'True', 'Do you want to collect CVV Number?', '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 ('CVV Number Length', 'CC_CVV_MIN_LENGTH', '3', 'Define CVV length. The default is 3 and should not be changed unless the industry standard changes.', '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 ('Split  Card E-Mail Address', 'MODULE_PAYMENT_CC_EMAIL', '', 'If an e-mail address is entered, the middle digits of the  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())");
// added new configuration keys
  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 ('Accept DINERS CLUB cards', 'MODULE_PAYMENT_CC_ACCEPT_DINERSCLUB','False', 'Accept DINERS CLUB cards?', 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, set_function, date_added) values ('Accept AMERICAN EXPRESS cards', 'MODULE_PAYMENT_CC_ACCEPT_AMERICANEXPRESS','False', 'Accept AMERICAN EXPRESS cards?', 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, set_function, date_added) values ('Accept CARTE BLANCHE cards', 'MODULE_PAYMENT_CC_ACCEPT_CARTEBLANCHE','False', 'Accept CARTE BLANCHE cards?', 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, set_function, date_added) values ('Accept AUSTRALIAN BANKCARD cards', 'MODULE_PAYMENT_CC_ACCEPT_OZBANKCARD','False', 'Accept AUSTRALIAN BANK cards?', 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, set_function, date_added) values ('Accept DISCOVER/NOVUS cards', 'MODULE_PAYMENT_CC_ACCEPT_DISCOVERNOVUS','False', 'Accept DISCOVERNOVUS cards?', 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, set_function, date_added) values ('Accept DELTA cards', 'MODULE_PAYMENT_CC_ACCEPT_DELTA','False', 'Accept DELTA cards?', 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, set_function, date_added) values ('Accept ELECTRON cards', 'MODULE_PAYMENT_CC_ACCEPT_ELECTRON','False', 'Accept ELECTRON cards?', 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, set_function, date_added) values ('Accept MASTERCARD cards', 'MODULE_PAYMENT_CC_ACCEPT_MASTERCARD','False', 'Accept MASTERCARD cards?', 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, set_function, date_added) values ('Accept SWITCH cards', 'MODULE_PAYMENT_CC_ACCEPT_SWITCH','False', 'Accept SWITCH cards?', 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, set_function, date_added) values ('Accept SOLO cards', 'MODULE_PAYMENT_CC_ACCEPT_SOLO','False', 'Accept SOLO cards?', 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, set_function, date_added) values ('Accept JCB cards', 'MODULE_PAYMENT_CC_ACCEPT_JCB','False', 'Accept JCB cards?', 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, set_function, date_added) values ('Accept MAESTRO cards', 'MODULE_PAYMENT_CC_ACCEPT_MAESTRO','False', 'Accept MAESTRO cards?', 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, set_function, date_added) values ('Accept VISA cards', 'MODULE_PAYMENT_CC_ACCEPT_VISA','False', 'Accept VISA cards?', 6, 0, 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
// BMC Changes 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', 'USE_CC_CVV', 'CC_CVV_MIN_LENGTH', 'CC_ENC', 'MODULE_PAYMENT_CC_EMAIL', 'MODULE_PAYMENT_CC_ZONE', 'MODULE_PAYMENT_CC_ORDER_STATUS_ID', 'MODULE_PAYMENT_CC_SORT_ORDER','MODULE_PAYMENT_CC_ACCEPT_DINERSCLUB', 'MODULE_PAYMENT_CC_ACCEPT_AMERICANEXPRESS', 'MODULE_PAYMENT_CC_ACCEPT_CARTEBLANCHE', 'MODULE_PAYMENT_CC_ACCEPT_OZBANKCARD',
'MODULE_PAYMENT_CC_ACCEPT_DISCOVERNOVUS', 'MODULE_PAYMENT_CC_ACCEPT_DELTA', 'MODULE_PAYMENT_CC_ACCEPT_ELECTRON', '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_VISA');
   }
 }
?>

 

Hope you can help ;)

Thanks

James

Share this post


Link to post
Share on other sites

Hmmm ... this is odd ... both our cc.php's are the same version and date/time, but they are very different in construction :blink: . Which version of OSC are you using, and which version of the contribution?

 

I've just tried to paste a copy of my cc.php on here but for some reason it won't let me, but if you PM me with your email address I'll send you a copy.

 

:rolleyes:

Share this post


Link to post
Share on other sites

Hello,

 

To save us alot of heartache I wanted to ask if this contrib will install on ms2.2 (fairly fresh) without 100's of little hacks needed.

 

If anyone has done this can they let me know.

 

Many thanks

 

John

Share this post


Link to post
Share on other sites

Jamsy - you need to replace your cc.php file with the one provided in the mod, or do a compare and add the differences manually.

 

It installed fine on my MS2. There are a few little things that need to be looked at but nothing major. Everything you need is in this thread.

 

:rolleyes:

Share this post


Link to post
Share on other sites

I'm having an weird problem with this script. The credit card I use for testing is a VISA. It begins with 44602463XXXXXXXX

 

When I input the card number completely, I get this error:

The card you have entered is a <b>JCB</b><br>At this time we do not accept <b>JCB</b> as payment.

 

Anyone have any idea why it would do this? I have VISA enabled in the credit card module

 

thanks!

colin

Share this post


Link to post
Share on other sites

Some of the card validation numbers overlap for Visa and JCB in catalog/includes/classes/cc.validation.php. Since JCB card numbers are validated before Visa numbers in the code, a Visa card can be 'identified' as JCB. If you don't accept JCB you can comment out the JCB validation section in cc.validation.php, otherwise you'll need to change the card number ranges in the validation code.

 

 

 

 

:rolleyes:

Share this post


Link to post
Share on other sites

Before I install this contribution (CC_CVV+UK Switch v1.31 with Card Blacklist+Admin), does it work on ms1?

 

Is this a good contribution to use in UK ecommerce shops?

 

Thanks

Karen


K

.....................................................................

When the going get's tough,

the tough get going.

Share this post


Link to post
Share on other sites

If you look through the thread I think you'll find most people who have installed it have installed on MS1 ... bear in mind the changes discussed in this thread that need to be added to get it working properly though.

 

About one third of my sales are via Switch, so for me it's very worthwhile. Plus the card companies are now starting to ask merchants to collect CVV numbers for verification.

 

:rolleyes:

Share this post


Link to post
Share on other sites

Every now and again we get an order through but no credit card number. It is happening seemingly random but maybe 1 in every 12 orders. Instead of all the card numbers, start/end date etc it just says: 'Payment Method: Credit Card' All the other data is captured ok.

 

I have the cc_cvv+uk_switch v1_31 installed. My guess a problem with the validation, new cards with higher number ranges?

 

Anyone experiencing similiar problems? (these are a couple of posts about this from a while back but no replies)

 

Also we do a manual charge on the PDQ machine in the store and get 30%+ of customers using switch

 

Any help would be appreciated.

 

regards

 

Andrew

 

(previously posted on a separate thread)

Share this post


Link to post
Share on other sites

Andrew,

 

Can you post the first 6 digits of the cards that aren't making it through? - I'll check them on a list I have to see if we need to adjust the validation ranges. It would seem it's passing the 'this-is-a-valid-card-number' test based on the modulus validation but isn't getting identified by the current 'card type' validation. Strange that you're not getting any info passed back though ...

 

Are all the cards (that aren't getting through) Switch?

 

You might also consider updating the mod to the latest release ... there seems to be one or two things fixed/added:

 

-----Changlog-----

V1.1

Improved readme

Fixed typos in readme

V1.2

Added code changes for removing cc info

cc_validation.php changed to different number recognition method

includes/modules/payment/cc.php updated for MS1

V1.3

added CC blacklist and admin function adpated from a contribution posted by Mark Keith Evans

V1.31

fixed a missing language define statement.

V1.4

added validation bypass

added blacklist bypass

allow bypass of CVV collection (previously not working properly)

allow bypass of Issue collection

V1.41

added missing fields in table insert

V1.5

allow bypass of start date entry

improved readabilty of code in catalog/includes/modules/payment/cc.php

v1.6

allow encryption of cc number

 

tia

 

:rolleyes:

Share this post


Link to post
Share on other sites

Hi, thanks for the reply. I did wonder about upgrading to the V1.61 version.

 

So basically the;

'cc_cvv+encryption v1_61'

is the latest version of, same as;

'cc_cvv+uk_switch v1_31'?

 

Finding out which numbers have failed is one of my problems. The store owner will ring them up and get a card number but it seems like this is usually another card. (lots of people have more than one card and when told that the old one didn't work will quote a new card number)

 

Someone said that 676709***** etc didn't work but it worked fine when i tested it. Also 5434 has not worked

 

The validation is turned off in the admin. Just today we have had 4921XXXXXXXXXXXX which comes through fine as credit card type = 'CC' which is fine.

 

It is the ones that come through as Payment Method = 'Credit Card' which are a pain as the store owner has to chase the number up, more often than not results in a lost order.

 

If I can get a certain bin number that does not validate then i'll post it.

 

regards

 

Andrew

Share this post


Link to post
Share on other sites

Yes, v1.61 is the latest ... be sure to go through this thread and add the adjustments people have posted. You may find 1.61 has different validation code too ... this is from the v1.61 cc_validation.php:

 

5434 is a mastercard ...

 

// Mastercard	// Dee changed max from 549999 to 559999  
     } elseif ( ($NumberLeft6 >= 510000) && ($NumberLeft6 <= 559999) ) {
       $this->cc_type = 'Mastercard';
       $ShouldLength = 16;
        if ( strtolower(MODULE_PAYMENT_CC_ACCEPT_MASTERCARD) != 'true' ) {      
     return -5;

 

4921 is Visa ...

 

// Visa   
     } elseif ( (($NumberLeft6 >= 400000) && ($NumberLeft6 <= 499999))
           // ensure we exclude AMT only cards
           && !( (($NumberLeft6 >= 490300) && ($NumberLeft6 <= 490301))
              || (($NumberLeft6 >= 490310) && ($NumberLeft6 <= 490334))
              || (($NumberLeft6 >= 490340) && ($NumberLeft6 <= 490399))
              || (($NumberLeft6 >= 490400) && ($NumberLeft6 <= 490409))
              || ($NumberLeft6 == 490419)
              || ($NumberLeft6 == 490451)
              || ($NumberLeft6 == 490459)
              || ($NumberLeft6 == 490467)
              || (($NumberLeft6 >= 490475) && ($NumberLeft6 <= 490478))
              || (($NumberLeft6 >= 490500) && ($NumberLeft6 <= 490599))
              || (($NumberLeft6 >= 491103) && ($NumberLeft6 <= 491173))
              || (($NumberLeft6 >= 491183) && ($NumberLeft6 <= 491199))
              || (($NumberLeft6 >= 492800) && ($NumberLeft6 <= 492899))
              || (($NumberLeft6 >= 498700) && ($NumberLeft6 <= 498799)) ) ) {
       $this->cc_type = 'Visa';

 

and 676709 seems to be Maestro...

 

// Maestro    
     } elseif ( (($NumberLeft6 >= 500000) && ($NumberLeft6 <= 500099))
           || (($NumberLeft6 >= 560000) && ($NumberLeft6 <= 589999))
           || (($NumberLeft6 >= 600000) && ($NumberLeft6 <= 699999)) ) {
       $this->cc_type = 'Maestro';
    $ShouldLength = 16;
        if ( strtolower(MODULE_PAYMENT_CC_ACCEPT_MAESTRO) != 'true' ) {
        return -5;

 

So if you don't have the above validation in your present cc_validation.php then perhaps 1.61 will remove a lot of the problems you're having.

 

hth

 

:rolleyes:

Share this post


Link to post
Share on other sites

Ive doubled checked all of my files..

No errors (that good)

But the CVV numbers are not showing up in the admin (orders)

 

Anyone have any ideas?

 

Thanks

Tammy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×