class PluginSettingsForm(PaymentPluginSettingsFormBase): url = URLField(_('API URL'), [DataRequired()], description=_('URL of the TouchNet HTTP API.')) business = StringField( _('Business'), [Optional(), validate_business], description=_( 'The default TouchNet ID or email address associated with a TouchNet account. ' 'Event managers will be able to override this.'))
class EventSettingsForm(PaymentEventSettingsFormBase): business = StringField( _('Business'), [ UsedIf(lambda form, _: form.enabled.data), DataRequired(), validate_business ], description= _('The TouchNet ID or email address associated with a TouchNet account.' ))
def validate_business(form, field): """Valiates a TouchNet business string. It can either be an email address or a touchnet business account ID. """ if not is_valid_mail(field.data, multi=False) and not re.match(r'^[a-zA-Z0-9]{13}$', field.data): raise ValidationError(_('Invalid email address / touchnet ID'))
class EventSettingsForm(PaymentEventSettingsFormBase): site_id = IntegerField(_('Site Id'), [DataRequired(), validate_site_id], description=_('TouchNet uPay Site Id associated with event.')) validation_key = StringField(_('Validation Key'), [DataRequired(), validate_key], description=_('TouchNet validation key associated with event.')) posting_value = StringField(_('Posting Value'), [DataRequired(), validate_key], description=_('TouchNet posting value associated with event.'))
def _process(self): flash(_('You cancelled the payment process.'), 'info') return redirect(url_for('event_registration.display_regform', self.registration.locator.registrant))
def _process(self): flash(_('Your payment request has been processed.'), 'success') return redirect(url_for('event_registration.display_regform', self.registration.locator.registrant))
class PluginSettingsForm(PaymentPluginSettingsFormBase): url = URLField(_('Touchnet uPay API URL'), [DataRequired()], description=_('URL of the uPay HTTP API.'))