예제 #1
0
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.'))
예제 #2
0
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.'
          ))
예제 #3
0
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'))
예제 #4
0
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.'))
예제 #5
0
 def _process(self):
     flash(_('You cancelled the payment process.'), 'info')
     return redirect(url_for('event_registration.display_regform', self.registration.locator.registrant))
예제 #6
0
 def _process(self):
     flash(_('Your payment request has been processed.'), 'success')
     return redirect(url_for('event_registration.display_regform', self.registration.locator.registrant))
예제 #7
0
class PluginSettingsForm(PaymentPluginSettingsFormBase):
    url = URLField(_('Touchnet uPay API URL'), [DataRequired()], description=_('URL of the uPay HTTP API.'))