Пример #1
0
class PaymentForm(forms.ModelForm):
    security_code = SecurityCodeField(max_length=4,
                                      label='CVV/CVC',
                                      widget=forms.TextInput(attrs={
                                          'placeholder': "123",
                                          'id': "CVV",
                                      }))
    card_expiration_date = forms.CharField(
        max_length=5,
        min_length=5,
        widget=forms.TextInput(attrs={
            'placeholder': "MM YY",
            'id': "expDate",
        }))
    card_number = forms.CharField(max_length=19,
                                  widget=forms.TextInput(attrs={
                                      'id': "cardNR",
                                  }))
    card_holder_name = forms.CharField(
        max_length=26,
        widget=forms.TextInput(
            attrs={
                'id': "holderName",
                'onkeydown': "return /[A-Za-z ]/i.test(event.key)",
            }))

    class Meta:
        model = Payment_Info
        fields = [
            'billing_address', 'card_number', 'card_holder_name',
            'card_expiration_date'
        ]
Пример #2
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
Пример #3
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)
Пример #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']
Пример #5
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']
Пример #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"
Пример #7
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'
Пример #8
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')
Пример #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)
Пример #10
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')
Пример #11
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
Пример #12
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()))
Пример #13
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'}))
Пример #14
0
class PizzeriaRequestForm(forms.ModelForm):

    cc_expiry = CardExpiryField(label='Fecha de expiración')
    cc_code = SecurityCodeField(label='Código seguridad')

    def __init__(self, *args, **kwargs):
        super(PizzeriaRequestForm, self).__init__(*args, **kwargs)
        self.fields['comment'].widget.attrs.update({'rows': 3, 'cols': 5})

    class Meta:
        model = PizzeriaRequest
        fields = [
            'representative_full_name', 'phone', 'email', 'comment',
            "company_name", "address", "cc_number"
        ]
Пример #15
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")
Пример #16
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')
Пример #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:")
Пример #18
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)
Пример #19
0
class CardCode(forms.Form):
    code = SecurityCodeField()
Пример #20
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')
Пример #21
0
class CreditCardForm(forms.Form):
    name = forms.CharField(max_length=50)
    card_number = forms.CharField()
    expire_date = CardExpiryField()
    ccr = SecurityCodeField()
Пример #22
0
class PaymentForm(Form):
    cc_number = CardNumberField(label="Card Number")
    cc_expiry = CardExpiryField(label="Expiration Date")
    cc_code = SecurityCodeField(label="CVV/CVC")
Пример #23
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')
Пример #24
0
class PaymentForm(forms.Form):
    cc_number = CardNumberField(label='Card Number')
    cc_expiry = CardExpiryField(label='Expiration Date')
    cc_code = SecurityCodeField(label='CVV/CVC')