Exemplo n.º 1
0
class CheckoutForm(forms.Form):

    address_option = forms.ChoiceField(widget=forms.RadioSelect,
                                       choices=ADDRESS_CHOICES)
    shipping_address = forms.CharField(
        required=False, widget=forms.TextInput(attrs={'placeholder': ' '}))
    address_details = forms.CharField(
        required=False,
        widget=forms.TextInput(attrs={
            'placeholder': ' ',
            'class': 'form-control'
        }))  # here must be city with options(Giza ,Cairo )
    save_new_address = forms.BooleanField(required=False)

    city = forms.CharField(label='select city',
                           widget=forms.Select(choices=CITIES))
    zip = forms.CharField(required=False)

    payment_option = forms.ChoiceField(widget=forms.RadioSelect,
                                       choices=PAYMENT_CHOICES)
    save_card_info = forms.BooleanField(required=False)

    card_owner = forms.CharField(max_length=100, required=False)
    card_number = CardNumberField(label='Card Number', required=False)
    card_expiry = CardExpiryField(label='Expiration Date', required=False)
    cvv = SecurityCodeField(label='CVV/CVC', required=False)
    assert types.get_type('0000000000000000') == types.CC_TYPE_GENERIC
Exemplo n.º 2
0
class SetPlanForm(forms.Form):
    zip = forms.CharField(required=False)
    card_number = CardNumberField()
    expiry = CardExpiryField()
    cvc = SecurityCodeField()
    plan = forms.ChoiceField(choices=tuple(
        (o, o) for o in settings.PLAN_DEFINITIONS.keys()),
                             required=False)
Exemplo n.º 3
0
class AddCreditCard(forms.ModelForm):
    cc_name = forms.CharField(label='Name on Card')
    cc_number = CardNumberField(label='Card Number')
    cc_expiry = CardExpiryField(label='Expiration Date')
    cc_code = SecurityCodeField(label='CVV/CVC')

    class Meta:
        model = CreditCard
        fields = ['cc_name', 'cc_number', 'cc_expiry', 'cc_code']
Exemplo n.º 4
0
class PaymentForm(forms.Form):
    cc_number = CardNumberField(label='Card Number', widget=forms.TextInput(attrs={'class': 'form-control validate', 'id': 'orangeForm-pass',}))
    cc_expiry = CardExpiryField(label='Expiration Date', widget=forms.TextInput(attrs={'class': 'form-control validate', 'id': 'orangeForm-pass',}))
    cc_code = SecurityCodeField(label='CVV/CVC', widget=forms.TextInput(attrs={'class': 'form-control validate', 'id': 'orangeForm-pass',}))

    def save(self):
        self.cc_numberClean = self.cleaned_data['cc_number']
        self.cc_expiryClean = self.cleaned_data['cc_expiry']
        self.cc_codeClean = self.cleaned_data['cc_code']
Exemplo n.º 5
0
class PaymentForm(forms.Form):
    cc_number = CardNumberField(label='Card Number')
    cc_expiry = CardExpiryField(label='Expiration Date')
    cc_code = SecurityCodeField(label='CVV/CVC')

    def __init__(self, *args, **kwargs):
        super(PaymentForm, self).__init__(*args, **kwargs)

        for visible in self.visible_fields():
            visible.field.widget.attrs['class'] = 'form-control'
Exemplo n.º 6
0
class CreditCardForm(forms.Form):
    cc_number = CardNumberField(label='Credit card number')
    cc_expiry = CardExpiryField(label='Expiration')
    cc_code = SecurityCodeField(label='CVV')

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.fields['cc_number'].widget.attrs['class'] = "form-control"
        self.fields['cc_expiry'].widget.attrs['class'] = "form-control"
        self.fields['cc_code'].widget.attrs['class'] = "form-control"
Exemplo n.º 7
0
class PaymentForm(ModelForm):
    """ The payment information form """
    first_name = forms.CharField(max_length=30, required=True, label='First Name')
    last_name = forms.CharField(max_length=30, required=True, label='Last Name')
    card_number = CardNumberField(required=True, label='Card Number')
    expiration_date = CardExpiryField(required=True, label='Expiration Date')
    cvv = SecurityCodeField(required=True, label='CVV/CVC')

    class Meta:
        model = PaymentInformation
        fields = ('first_name', 'last_name' , 'card_number', 'expiration_date', 'cvv')
Exemplo n.º 8
0
class PaymentForm(forms.ModelForm):
    CardholderName = forms.CharField(required=True)
    cc_number = CardNumberField(label='Card Number')
    cc_code = SecurityCodeField(label='CVV/CVC')
    Expiration_Date = forms.CharField(widget=forms.Select(
        choices=MONTH_CHOICE))
    Year = forms.IntegerField(widget=forms.Select(choices=YEAR_DROPDOWN))

    class Meta:
        model = Payment
        fields = ('cc_number', 'cc_code', 'Expiration_Date', 'Year',
                  'CardholderName')
Exemplo n.º 9
0
class RegistroTarjeta(forms.Form):
    number = CardNumberField(label='Número de tarjeta',
                             error_messages={
                                 'invalid':
                                 'La tarjeta debe tener entre 12 y 16 numeros'
                             })
    date_expiration = CardExpiryField(error_messages={
        'date_passed': 'Fecha Invalida',
    })
    cod = SecurityCodeField(error_messages={'invalid': 'Código inválido'}, )
    card_name = forms.CharField(max_length=50)
    bank = forms.CharField(max_length=50)
Exemplo n.º 10
0
class PaymentForm(forms.Form):
    name = forms.CharField(
        widget=forms.TextInput(attrs={
            'class': 'form-control',
            'placeholder': 'Fullt nafn korthafa'
        }),
        required=True,
        max_length=100)
    card_nbr = CardNumberField(label='Kortanúmer')
    card_nbr.error_messages = {
        'invalid': 'Vinsamlegast sláðu inn gilt kortanúmer'
    }

    months = [('01', '01'), ('02', '02'), ('03', '03'), ('04', '04'),
              ('05', '05'), ('06', '06'), ('07', '07'), ('08', '08'),
              ('09', '09'), ('10', '10'), ('11', '11'), ('12', '12')]
    # We set the current month as the default value in the exp_month field
    initial_month = datetime.now().month
    if initial_month < 10:
        initial_month = '0' + str(initial_month)
    exp_month = forms.ChoiceField(
        choices=months,
        initial=initial_month,
        widget=forms.Select(attrs={'class': 'form-control'}))
    exp_month.label = 'Gildistími'

    year = datetime.now().year
    years = []
    # We only show 5 years in the exp_year field since credit cards expire within that timerange
    for i in range(5):
        years.append((str(year + i), str(year + i)[2:]))
    exp_year = forms.ChoiceField(
        choices=years,
        initial=year,
        widget=forms.Select(attrs={'class': 'form-control'}))
    exp_year.label = 'Gildisár'

    cvc_nbr = SecurityCodeField(label='CVV/CVC', min_length=3, max_length=4)
    cvc_nbr.error_messages = {
        'invalid': 'Vinsamlegast sláðu inn gilt CVC númer'
    }

    def clean(self):
        exp_month = self.cleaned_data['exp_month']
        exp_year = self.cleaned_data['exp_year']

        # For see if the user inputs a date that is less than the current date
        if int(exp_year) == int(datetime.now().year):
            if int(exp_month) < int(datetime.now().month):
                raise ValidationError(_('Gildistími er liðinn'),
                                      code='invalid')
        return self.cleaned_data
Exemplo n.º 11
0
class WizardForm(forms.Form):
    home_airport = JSONField()
    email = forms.EmailField()
    password = forms.CharField(widget=forms.PasswordInput)
    first_name = forms.CharField()
    last_name = forms.CharField()
    promo_code = forms.CharField(required=False)
    zip = forms.CharField(required=False)
    card_number = CardNumberField(required=False)
    expiry = CardExpiryField(required=False)
    cvc = SecurityCodeField(required=False)
    plan = forms.ChoiceField(choices=tuple(
        (o, o) for o in settings.PLAN_DEFINITIONS.keys()))
Exemplo n.º 12
0
class PaymentForm(forms.Form):
    name_on_the_card = forms.CharField(
        max_length=255,
        label="Name",
        widget=forms.TextInput(attrs={'placeholder': 'Name'}))
    cc_number = CardNumberField(
        label='Card Number',
        widget=forms.TextInput(attrs={'placeholder': 'Credit card number'}))
    cc_expiry = CardExpiryField(
        label='Expiration Date',
        widget=forms.TextInput(attrs={'placeholder': 'Expiry date'}))
    cc_code = SecurityCodeField(
        label='CVV/CVC',
        widget=forms.TextInput(attrs={'placeholder': 'CVV/CVC'}))
Exemplo n.º 13
0
class WizardForm(forms.Form):
    home_airport = JSONField()
    email = forms.EmailField()
    password = forms.CharField(widget=forms.PasswordInput)
    first_name = forms.CharField()
    last_name = forms.CharField()
    promo_code = forms.CharField(required=False)
    zip = forms.CharField(required=False)
    card_number = CardNumberField(required=False)
    expiry = MyCardExpiryField(required=False)
    cvc = SecurityCodeField(required=False)
    plan = forms.ChoiceField(choices=tuple(
        (o, o) for o in settings.PLAN_DEFINITIONS.keys()),
                             required=False)

    def clean(self):
        cd = self.cleaned_data
        if cd.get("plan"):
            if not (cd.get("card_number") and cd.get("expiry")
                    and cd.get("cvc")):
                raise ValidationError(
                    "Paid account requires payment credentials")
Exemplo n.º 14
0
class PaymentForm(forms.Form):
    name_on_card = forms.CharField(required=True,
                                   label="Name on Card",
                                   max_length=100)
    number = CardNumberField(required=True, label="Card Number")
    expiration = CardExpiryField(required=True, label="Expiration Date")

    cvc = forms.CharField(required=True,
                          label="CVV/CVC",
                          widget=forms.TextInput(attrs={
                              'size': '3',
                              'maxlength': '3',
                              'placeholder': ''
                          }))

    country = forms.CharField(required=False,
                              max_length=255,
                              label="City",
                              widget=forms.TextInput())
    zip = forms.CharField(required=False,
                          max_length=255,
                          label=mark_safe("&nbsp;&nbsp;&nbsp;Zip"),
                          widget=forms.TextInput())
Exemplo n.º 15
0
class CardNumber(forms.Form):
    number = CardNumberField()
Exemplo n.º 16
0
class BillingForm(forms.Form):
    cc_name = forms.CharField(max_length=150)
    cc_number = CardNumberField(label='Card Number', widget=forms.TextInput(attrs={'size': '40'}))
    cc_expiry = CardExpiryField(label='Expiration Date')
    cc_code = SecurityCodeField(label='CVV/CVC')
Exemplo n.º 17
0
class PaymentInfoForm(forms.Form):
    cardholder = forms.CharField(max_length=255, label="Cardholder full name:")
    card_number = CardNumberField(label="Credit Card Number:")
    exp_date = CardExpiryField(label="Card Expiry Date:")
    cvc_code = SecurityCodeField(label="CVC/CVV Code:")
Exemplo n.º 18
0
class PaymentForm(Form):
    cc_number = CardNumberField(label="Card Number")
    cc_expiry = CardExpiryField(label="Expiration Date")
    cc_code = SecurityCodeField(label="CVV/CVC")
Exemplo n.º 19
0
class PaymentForm(forms.Form):
    full_name = forms.CharField(label="Nombre")
    identification = forms.IntegerField(label="Idenficación")
    cc_number = CardNumberField(label='Card Number')
    cc_expiry = CardExpiryField(label='Expiration Date')
    cc_code = SecurityCodeField(label='CVV/CVC')
Exemplo n.º 20
0
class PaymentForm(forms.Form):
    cc_number = CardNumberField(label='Card Number')
    cc_expiry = CardExpiryField(label='Expiration Date')
    cc_code = SecurityCodeField(label='CVV/CVC')
    address = forms.CharField(max_length=100, required=True)
Exemplo n.º 21
0
class PaymentForm(forms.Form):
    cc_number = CardNumberField(label='Card Number')
    cc_expiry = CardExpiryField(label='Expiration Date')
    cc_code = SecurityCodeField(label='CVV/CVC')
Exemplo n.º 22
0
class PaymentForm(Form):
    cardholder_name = CharField(max_length=255, label="Cardholder's Name")
    card_number = CardNumberField(label='Card Number')
    expiry_date = CardExpiryField(label='Expiration Date')
    cvc = SecurityCodeField(label='CVV/CVC')