Metadata-Version: 2.1
Name: django-credit-cards
Version: 0.3
Summary: A Django app providing database and form fields for credit cards.
Home-page: https://github.com/dldevinc/django-credit-cards
Author: Mihail Mishakin
Author-email: x896321475@gmail.com
License: MIT
Keywords: django credit card
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3
Description-Content-Type: text/markdown
Requires-Dist: Django (>=1.8)


# django-credit-cards
A Django app providing database and form fields for credit cards.

## Compatibility
* `django` >= 1.8
* `python` >= 3

## Quickstart
Install django-credit-cards:
```bash
pip install django-credit-cards
```

Then add it to your models:
```python
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:
```python
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
```python
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 MIT license (see LICENSE)


