コード例 #1
0
ファイル: plugin.py プロジェクト: dsquire/indico-plugins
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
ファイル: plugin.py プロジェクト: dsquire/indico-plugins
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
ファイル: util.py プロジェクト: dsquire/indico-plugins
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.'))