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.'))
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.') )
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'))
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))
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))