Subversion Repositories wpShopGermany4

Rev

Rev 5866 | Rev 6142 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5866 Rev 6030
Line 136... Line 136...
136
	if (isANumber === false) { bb = false; }
136
	if (isANumber === false) { bb = false; }
137
	a1 = knr.substr(0, 1);
137
	a1 = knr.substr(0, 1);
138
	ai = parseInt(knr.substr(15, 1), 10);
138
	ai = parseInt(knr.substr(15, 1), 10);
139
	if (!(((a1 === "4") && (typ === "VISA")) || ((a1 === "5") && (typ === "MasterCard")))) { bb = false; }
139
	if (!(((a1 === "4") && (typ === "VISA")) || ((a1 === "5") && (typ === "MasterCard")))) { bb = false; }
140
	for (i = 14; i >= 0; i--) {
140
	for (i = 14; i >= 0; i--) {
-
 
141
        dig = k * parseInt(knr.substr(i, 1), 10);
-
 
142
        if (dig > 9) { dig = dig - 9;}
-
 
143
		sum = sum + dig;
141
		sum = sum + k * parseInt(knr.substr(i, 1), 10);
144
		//sum = sum + k * parseInt(knr.substr(i, 1), 10);
142
		if (k === 2) { k = 1; } else { k = 2; }
145
		if (k === 2) { k = 1; } else { k = 2; }
143
	}
146
	}
144
	sum = sum % 10;
147
	sum = sum % 10;
145
	if (sum > 0) { sum = 10 - sum; }
148
	if (sum > 0) { sum = 10 - sum; }
146
	if (sum !== ai) { bb = false; }
149
	if (sum !== ai) { bb = false; }