2014-07-30 12:55:33 +00:00
|
|
|
from django import forms
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from rest_framework import serializers
|
|
|
|
|
2014-11-24 14:39:41 +00:00
|
|
|
from orchestra.plugins.forms import PluginDataForm
|
2014-07-30 12:55:33 +00:00
|
|
|
|
2014-09-26 21:24:23 +00:00
|
|
|
from .options import PaymentMethod
|
2014-07-30 12:55:33 +00:00
|
|
|
|
2014-09-26 21:24:23 +00:00
|
|
|
|
|
|
|
class CreditCardForm(PluginDataForm):
|
2014-07-30 12:55:33 +00:00
|
|
|
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
|