summaryrefslogtreecommitdiff
path: root/views/mods/mod_creditcard
diff options
context:
space:
mode:
authorhartmut <noreply@maennchen1.de>2017-01-25 09:52:08 +0000
committerhartmut <noreply@maennchen1.de>2017-01-25 09:52:08 +0000
commitd2440af8de9f09467dc088cb122dec257959c110 (patch)
treec1bc1f0c3c5a3256201915418cfebde4cfee9610 /views/mods/mod_creditcard
parentd4d8c14fac56ba96048fac97c1ef21ac6bbd1432 (diff)
Statistik-Produkte und Korrektur Kreditkartennummer-Prüfziffernalgorithmus
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@6030 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_creditcard')
-rw-r--r--views/mods/mod_creditcard/paymenthint.phtml5
1 files changed, 4 insertions, 1 deletions
diff --git a/views/mods/mod_creditcard/paymenthint.phtml b/views/mods/mod_creditcard/paymenthint.phtml
index 5ffda92..d9cbbf2 100644
--- a/views/mods/mod_creditcard/paymenthint.phtml
+++ b/views/mods/mod_creditcard/paymenthint.phtml
@@ -138,7 +138,10 @@ jQuery("#wpsg_mod_creditcard_knr").on("input", function () {
ai = parseInt(knr.substr(15, 1), 10);
if (!(((a1 === "4") && (typ === "VISA")) || ((a1 === "5") && (typ === "MasterCard")))) { bb = false; }
for (i = 14; i >= 0; i--) {
- sum = sum + k * parseInt(knr.substr(i, 1), 10);
+ dig = k * parseInt(knr.substr(i, 1), 10);
+ if (dig > 9) { dig = dig - 9;}
+ sum = sum + dig;
+ //sum = sum + k * parseInt(knr.substr(i, 1), 10);
if (k === 2) { k = 1; } else { k = 2; }
}
sum = sum % 10;