mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-13 15:34:37 +00:00
Payment/Manual: Add settings
This commit is contained in:
parent
0d8678ce8f
commit
f428fe4bd0
@ -16,13 +16,34 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from wtforms.fields.simple import TextAreaField
|
||||
from wtforms.validators import DataRequired
|
||||
|
||||
from indico.core.plugins import IndicoPlugin
|
||||
from indico.modules.payment import PaymentPluginMixin, PaymentPluginSettingsFormBase, PaymentEventSettingsFormBase
|
||||
from indico.util.i18n import _
|
||||
from indico.web.forms.validators import UsedIf
|
||||
|
||||
|
||||
class ManualPaymentPlugin(IndicoPlugin):
|
||||
DETAILS_DESC = _('The details the user needs to make their payment. This usually includes the bank account details '
|
||||
'the IBAN and payment reference.')
|
||||
|
||||
|
||||
class PluginSettingsForm(PaymentPluginSettingsFormBase):
|
||||
details = TextAreaField(_('Payment details'), [], description=DETAILS_DESC)
|
||||
|
||||
|
||||
class EventSettingsForm(PaymentEventSettingsFormBase):
|
||||
details = TextAreaField(_('Payment details'), [UsedIf(lambda form, _: form.enabled.data), DataRequired()],
|
||||
description=DETAILS_DESC)
|
||||
|
||||
|
||||
class ManualPaymentPlugin(PaymentPluginMixin, IndicoPlugin):
|
||||
"""Manual Payment
|
||||
|
||||
Provides a payment method where bank details etc. are shown to the user
|
||||
who then pays manually using e.g. a wire transfer. Marking the registrant
|
||||
as paid is then done manually by a manager of the event.
|
||||
"""
|
||||
settings_form = PluginSettingsForm
|
||||
event_settings_form = EventSettingsForm
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user