diff options
author | Patryk Zawadzki <patrys@room-303.com> | 2014-06-10 14:12:01 +0200 |
---|---|---|
committer | Patryk Zawadzki <patrys@room-303.com> | 2014-06-10 14:12:01 +0200 |
commit | 1d476a9ab6d810ee8e55acb96a0032cdca974bcf (patch) | |
tree | 68319ed32fa68d7963e1453693bfd95383ee3e2e /payments/__init__.py | |
parent | d48af9c8e9741a9514cd2523fb4dc7f460dfb5b5 (diff) | |
download | django-payments-taler-1d476a9ab6d810ee8e55acb96a0032cdca974bcf.tar.gz django-payments-taler-1d476a9ab6d810ee8e55acb96a0032cdca974bcf.tar.bz2 django-payments-taler-1d476a9ab6d810ee8e55acb96a0032cdca974bcf.zip |
Accept spaces and dashes in card numbers, recognize Maestro
Diffstat (limited to 'payments/__init__.py')
-rw-r--r-- | payments/__init__.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/payments/__init__.py b/payments/__init__.py index 67531e5..e9ee12a 100644 --- a/payments/__init__.py +++ b/payments/__init__.py @@ -134,12 +134,13 @@ def get_payment_model(): CARD_TYPES = [ - ('^4[0-9]{12}(?:[0-9]{3})?$', 'visa', 'VISA'), - ('^5[1-5][0-9]{14}$', 'mastercard', 'MasterCard'), - ('^6(?:011|5[0-9]{2})[0-9]{12}$', 'discover', 'Discover'), - ('^3[47][0-9]{13}$', 'amex', 'American Express'), - ('^(?:(?:2131|1800|35\d{3})\d{11})$', 'jcb', 'JCB'), - ('^(?:3(?:0[0-5]|[68][0-9])[0-9]{11})$', 'diners', 'Diners Club')] + (r'^4[0-9]{12}(?:[0-9]{3})?$', 'visa', 'VISA'), + (r'^5[1-5][0-9]{14}$', 'mastercard', 'MasterCard'), + (r'^6(?:011|5[0-9]{2})[0-9]{12}$', 'discover', 'Discover'), + (r'^3[47][0-9]{13}$', 'amex', 'American Express'), + (r'^(?:(?:2131|1800|35\d{3})\d{11})$', 'jcb', 'JCB'), + (r'^(?:3(?:0[0-5]|[68][0-9])[0-9]{11})$', 'diners', 'Diners Club'), + (r'^(?:5[0678]\d\d|6304|6390|67\d\d)\d{8,15}$', 'maestro', 'Maestro')] def get_credit_card_issuer(number): |