With Paypal, your options are very limited. If you use Paypal Pro, you can check if the card exists and is legal by making authorization for only $ 0.00. If you use other payment methods offered by Paypal, you cannot do this.
, , . , , Luhn. , . , , . , CVV Visa, MasterCard Discover American Express.
, , , .
EDIT ( Luhn PHP):
function passes_luhn_check($cc_number) {
$checksum = 0;
$j = 1;
for ($i = strlen($cc_number) - 1; $i >= 0; $i--) {
$calc = substr($cc_number, $i, 1) * $j;
if ($calc > 9) {
$checksum = $checksum + 1;
$calc = $calc - 10;
}
$checksum += $calc;
$j = ($j == 1) ? 2 : 1;
}
if ($checksum % 10 != 0) {
return false;
}
return true;
}
:
$valid_cc = passes_luhn_check('4427802641004797'); // returns true
$valid_cc = passes_luhn_check('4427802641004798'); // returns false