|
|
|
| Title : |
After discovering some credit card validation routines didnt work - here is one that I found works with all the numbers I have tried so far |
| Categories : |
Credit Cards, Ecommerce, PHP |
 John Craig |
| Date : |
Mar 02nd 1999 |
| Grade : |
4 of 5 (graded 2 times) |
| Viewed : |
13043 |
| File : |
No file for this code example. |
| Images : |
No Images for this code example. |
|
| Search : |
More code by John Craig |
|
| Action : |
Grade This Code Example
|
|
| Tools : |
My Examples List |
|
|
|
|
|
|
function CC_checksum($ccard){
if(strlen($ccard) < 1)
return 0;
$ccard = ereg_replace("[^[:digit:]]+", "", $ccard);
$checksum = 0;
$factor = (strlen($ccard) % 2) ? 1 : 2;
for($i = 0; $i < strlen($ccard); $i++){
$digit = substr($ccard, $i, 1);
$checksum += ($digit * $factor > 9) ? $digit * $factor - 9 : $digit * $factor;
$factor = ($factor == 1) ? 2 : 1;
}
return !($checksum % 10);
} |
|
| an example of the cyberlib payment class Categories : PHP, PHP Classes, Ecommerce, Credit Cards | | | credit card security code Categories : PHP, Credit Cards, PHP Classes, Credit Cards | | | Credit Card Identification and Validation Class - The credit_card class provides methods for cleaning, validating and identifying the type of credit card numbers. Categories : PHP, PHP Classes, Credit Cards, Ecommerce, Algorithms | | | Validation function for LUHNMod10 and variant. Can discriminate credit card numbers of varying lengths. Uses [Double >> Sum-of-Digits] transform. Categories : Credit Cards, Authentication, Ecommerce, PHP | | | ECHOcart - Open Source Shopping Cart Categories : PHP, Credit Cards, Ecommerce | | | A set of functions to check the validity of a credit card number. Categories : Ecommerce, Credit Cards, PHP | | | Credit Card validation routine. Uses MOD 10 to check if credit card number is valid. Categories : Ecommerce, Credit Cards, PHP, Complete Programs | | | This is a redirection program which is as good as the come.to v3 url
redirection, complete with admin interface all clients stored in mysql
Categories : PHP, MySQL, Ecommerce, HTML and PHP, Complete Programs | | | Shopping Basket On-Line Ordering System. Categories : Complete Programs, MySQL, PHP, Ecommerce, Databases | | | Credit Card Numbers for testing Categories : Credit Cards, Ecommerce, Debugging | | | Adds dashes to a CC number. Was from this site, but now it works. Categories : PHP, Credit Cards | | | PHPCatalog Categories : Ecommerce, PHP, Complete Programs | | | Authorize.net AIM Interface Class v1.0.0 Categories : PHP, PHP Classes, Ecommerce, Payment Gateways | | | Amazon book cover handling Categories : HTML and PHP, PHP, MySQL, Ecommerce | | | Validating Credit Card Numbers Without Bank Involvement
Categories : Credit Cards, Ecommerce, Java Script | |
| |
| |
|