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