django-credit-cards
A Django app providing database and form fields for credit cards.
Compatibility
django>= 1.8python>= 3
Quickstart
Install django-credit-cards:
pip install django-credit-cards
Then add it to your models:
from creditcards.models import CardNumberField, CardExpiryField, SecurityCodeField
class Payment(models.Model):
cc_number = CardNumberField(_('card number'))
cc_expiry = CardExpiryField(_('expiration date'))
cc_code = SecurityCodeField(_('security code'))
Or to your forms:
from creditcards.forms import CardNumberField, CardExpiryField, SecurityCodeField
class PaymentForm(forms.Form):
cc_number = CardNumberField(label='Card Number')
cc_expiry = CardExpiryField(label='Expiration Date')
cc_code = SecurityCodeField(label='CVV/CVC')
Credit Card Type Detection
from creditcards import types
assert types.get_type('4444333322221111') == types.CC_TYPE_VISA
assert types.get_type('343434343434343') == types.CC_TYPE_AMEX
assert types.get_type('0000000000000000') == types.CC_TYPE_GENERIC
License
Copyright (c) 2018 Mihail Mishakin Released under the BSD license (see LICENSE)
Release files for django-credit-cards 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-credit-cards-0.4.1.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_credit_cards-0.4.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 13.0 kB
Release files / django-credit-cards-0.4.1.tar.gz
| Download URL | django-credit-cards-0.4.1.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9c51399b718375cbddee18c13559de154c8de1b1cae4ae9e5db29d5df258bff
|
|
BLAKE2b-256 checksum How to use checksums |
f4878c1d328b8451d7a7b7abd492c9f093153aba35d957a70eb5b95ad29058b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
|
Release files / django_credit_cards-0.4.1-py2.py3-none-any.whl
| Download URL | django_credit_cards-0.4.1-py2.py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
63f651070d556689d57907d49a5fd6a12df698db303665c0daebdcefc34abe96
|
|
BLAKE2b-256 checksum How to use checksums |
a1cfd23dcb1a7631cd0c3339c4be08ccb74feff46137c06e794f9ce70d46375f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
|