macsnjets Posted December 6, 2002 Posted December 6, 2002 I Imagine if I don't want to accept a particular card I would have to edit the following code but exactly what do I remove? ....thanks 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)) { $this->cc_type = 'American Express'; } elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) { $this->cc_type = 'Diners Club'; } elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) { $this->cc_type = 'Discover'; } elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) { $this->cc_type = 'JCB'; } else { return -1; }
Guest Posted December 6, 2002 Posted December 6, 2002 } elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) { $this->cc_type = 'Diners Club'; Just delete the part I have quoted here..so it will look like this 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)) { $this->cc_type = 'American Express'; } elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) { $this->cc_type = 'Discover'; } elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) { $this->cc_type = 'JCB'; } else { return -1; } Pete
macsnjets Posted December 6, 2002 Author Posted December 6, 2002 Thanks Pete, I'll get this thing going sooner or later :D
jon_l Posted December 7, 2002 Posted December 7, 2002 I haven't checked the latest card identification code, but I would be very wary of using it. The old code did not work - it would reject cards it should of accepted, and accepted cards it should of rejected. My merchant reckoned identifying cards in this way wasn't possible, due to the way card ranges are allocated and used. I removed all the card identification code as it was causing us to lose sales. Instead, we just list the card types we can accept. If someone uses an invalid card we just tell them, ask them if they want to use a different card, and if not, cancel the order. Jon.
macsnjets Posted December 7, 2002 Author Posted December 7, 2002 Hmmm, So you say I just strip the entire code above, List the cards we accept on the page, let the customer submit his card and if its not one we accept to just let the customer know after we recieve their order? Is that correct?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.