Hi List,

There is a bug in z3c.schema.payments' validating of credit card numbers. The first check to make sure the leading digit is valid is actually checking the second digit. I noticed this because it wouldn't validate my own card number. I've attached a diff from the current SVN trunk which corrects this issue.

Index: src/z3c/schema/payments/field.py
--- src/z3c/schema/payments/field.py    (revision 122267)
+++ src/z3c/schema/payments/field.py    (working copy)
@@ -27,7 +27,7 @@
        is low and pre-validating is fast"""
     financialIndustries = ['3','4','5','6']
-    if cardNum[1] not in financialIndustries:
+    if cardNum[0] not in financialIndustries:
         return False
     total = pos = 0
Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope )

Reply via email to