giftkountry Posted March 27, 2004 Share Posted March 27, 2004 I have been searching the contributions and the boards and I can't find out how to do this. I am setting up a store for a company which has in house charge accounts. Can anyone tell me how to do this or if there is a contribution I am not seeing Link to comment Share on other sites More sharing options...
AlanR Posted March 27, 2004 Share Posted March 27, 2004 What do you mean by in house charge accounts? A retail credit card terminal? Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management) Link to comment Share on other sites More sharing options...
stevel Posted March 27, 2004 Share Posted March 27, 2004 I'd think you could use the normal credit card system - just edit includes/classes/cc_validation.php to recognize the format of the credit card number and do whatever validation can be done on it. You may want to disable the code that accepts standard card numbers. For example, my store accepts MasterCard and Visa only, so I edited cc_validation.php as follows to disallow other cards: function validate($number, $expiry_m, $expiry_y) { $this->cc_number = ereg_replace('[^0-9]', '', $number); if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) { $this->cc_type = 'Visa'; } elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) { $this->cc_type = 'Master Card'; } elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) { return -1; // $this->cc_type = 'American Express'; } elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) { return -1; // $this->cc_type = 'Diners Club'; } elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) { return -1; // $this->cc_type = 'Discover'; } elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) { return -1; // $this->cc_type = 'JCB'; } elseif (ereg('^5610[0-9]{12}$', $this->cc_number)) { return -1; // $this->cc_type = 'Australian BankCard'; } else { return -1; } Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.