django-orchestra-test/orchestra/apps/payments/methods/creditcard.py

33 lines
1.0 KiB
Python
Raw Normal View History

from django import forms
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
2014-11-14 15:54:46 +00:00
from orchestra.apps.plugins.forms import PluginDataForm
2014-09-26 21:24:23 +00:00
from .options import PaymentMethod
2014-09-26 21:24:23 +00:00
class CreditCardForm(PluginDataForm):
label = forms.CharField(max_length=128, label=_("Label"),
help_text=_("Use a name such as \"Jo's Visa\" to remember which "
"card it is."))
first_name = forms.CharField(max_length=128)
last_name = forms.CharField(max_length=128)
address = forms.CharField(max_length=128)
zip = forms.CharField(max_length=128)
city = forms.CharField(max_length=128)
country = forms.CharField(max_length=128)
card_number = forms.CharField(max_length=128)
expiration_date = forms.CharField(max_length=128)
security_code = forms.CharField(max_length=128)
class CreditCardSerializer(serializers.Serializer):
pass
class CreditCard(PaymentMethod):
verbose_name = _("Credit card")
form = CreditCardForm
serializer = CreditCardSerializer