HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall_new/buyercall/buyercall/blueprints/billing/forms.py
from flask_babel import lazy_gettext as _
from flask_wtf import FlaskForm
from wtforms import StringField, HiddenField, IntegerField
from wtforms.validators import DataRequired, Optional, Length, NumberRange


class CreditCardForm(FlaskForm):
    stripe_key = HiddenField(_('Stripe key'),
                             [DataRequired(), Length(1, 254)])
    plan = HiddenField(_('Plan'),
                       [DataRequired(), Length(1, 254)])
    quantity = IntegerField(_('Package Quantity'),
                            [DataRequired(), NumberRange(
                                min=1,
                                max=9,
                                message='The quantity can not be less than 1 or more than 3')
                             ],
                            default=1)
    coupon_code = StringField(_('Do you have a discount code?'),
                              [Optional(), Length(1, 254)])
    name = StringField(_('Name on card'),
                       [DataRequired(), Length(1, 254)])


class UpdateSubscriptionForm(FlaskForm):
    coupon_code = StringField(_('Do you have a discount code?'),
                              [Optional(), Length(1, 254)])


class CancelSubscriptionForm(FlaskForm):
    pass