Example #1
0
class PluginSettingsForm(PaymentPluginSettingsFormBase):
    url = URLField(_('API URL'), [DataRequired()],
                   description=_('URL of the PayPal HTTP API.'))
    business = StringField(
        _('Business'), [Optional(), validate_business],
        description=_(
            'The default PayPal ID or email address associated with a PayPal account. '
            'Event managers will be able to override this.'))
Example #2
0
class EventSettingsForm(PaymentEventSettingsFormBase):
    business = StringField(
        _('Business'), [
            UsedIf(lambda form, _: form.enabled.data),
            DataRequired(), validate_business
        ],
        description=_(
            'The PayPal ID or email address associated with a PayPal account.')
    )
Example #3
0
def validate_business(form, field):
    """Valiates a PayPal business string.

    It can either be an email address or a paypal 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 / paypal ID'))
Example #4
0
def validate_business(form, field):
    """Valiates a PayPal business string.

    It can either be an email address or a paypal 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 / paypal ID'))
Example #5
0
 def _process(self):
     flash(_('You cancelled the payment process.'), 'info')
     return redirect(url_for('event_registration.display_regform', self.registration.locator.registrant))
Example #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))
Example #7
0
 def _process(self):
     flash(_('You cancelled the payment process.'), 'info')
     return redirect(
         url_for('event_registration.display_regform',
                 self.registration.locator.registrant))
Example #8
0
 def _process(self):
     flash(_('Your payment request has been processed.'), 'success')
     return redirect(
         url_for('event_registration.display_regform',
                 self.registration.locator.registrant))