[16717] | 1 | ## $Id: interfaces.py 16993 2022-07-06 07:49:44Z henrik $ |
---|
[15614] | 2 | ## |
---|
| 3 | ## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann |
---|
| 4 | ## This program is free software; you can redistribute it and/or modify |
---|
| 5 | ## it under the terms of the GNU General Public License as published by |
---|
| 6 | ## the Free Software Foundation; either version 2 of the License, or |
---|
| 7 | ## (at your option) any later version. |
---|
| 8 | ## |
---|
| 9 | ## This program is distributed in the hope that it will be useful, |
---|
| 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 12 | ## GNU General Public License for more details. |
---|
| 13 | ## |
---|
| 14 | ## You should have received a copy of the GNU General Public License |
---|
| 15 | ## along with this program; if not, write to the Free Software |
---|
| 16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
| 17 | ## |
---|
| 18 | |
---|
| 19 | import zope.i18nmessageid |
---|
| 20 | from zope import schema |
---|
| 21 | from zc.sourcefactory.basic import BasicSourceFactory |
---|
| 22 | from waeup.kofa.interfaces import (SimpleKofaVocabulary, |
---|
[16993] | 23 | ISessionConfiguration, academic_sessions_vocab, IKofaObject, |
---|
| 24 | DisablePaymentGroupSource) |
---|
[15614] | 25 | |
---|
[16983] | 26 | _ = MessageFactory = zope.i18nmessageid.MessageFactory('kofacustom.lpng') |
---|
[15614] | 27 | |
---|
[16993] | 28 | class ICustomSessionConfiguration(IKofaObject): |
---|
[15614] | 29 | """A session configuration object. |
---|
| 30 | """ |
---|
| 31 | |
---|
[16993] | 32 | academic_session = schema.Choice( |
---|
| 33 | title = _(u'Session'), |
---|
| 34 | source = academic_sessions_vocab, |
---|
| 35 | default = None, |
---|
| 36 | required = True, |
---|
| 37 | readonly = True, |
---|
[15614] | 38 | ) |
---|
| 39 | |
---|
[16993] | 40 | payment_disabled = schema.List( |
---|
| 41 | title = _(u'Payment disabled'), |
---|
| 42 | value_type = schema.Choice( |
---|
| 43 | source = DisablePaymentGroupSource(), |
---|
| 44 | ), |
---|
[15614] | 45 | required = False, |
---|
[16993] | 46 | defaultFactory=list, |
---|
[15614] | 47 | ) |
---|
| 48 | |
---|
[16993] | 49 | def getSessionString(): |
---|
| 50 | """Return the session string from the vocabulary. |
---|
| 51 | """ |
---|
[15614] | 52 | |
---|
[15847] | 53 | interswitch_enabled = schema.Bool( |
---|
[16724] | 54 | title = _(u'Interswitch Collegepay integration enabled'), |
---|
[15847] | 55 | default = False, |
---|
| 56 | ) |
---|
[15614] | 57 | |
---|
[16724] | 58 | interswitch_paydirect_enabled = schema.Bool( |
---|
| 59 | title = _(u'Interswitch Paydirect integration enabled'), |
---|
| 60 | default = False, |
---|
| 61 | ) |
---|
| 62 | |
---|
[15847] | 63 | etranzact_webconnect_enabled = schema.Bool( |
---|
| 64 | title = _(u'Etranzact Webconnect integration enabled'), |
---|
| 65 | default = False, |
---|
| 66 | ) |
---|
| 67 | |
---|
| 68 | etranzact_payoutlet_enabled = schema.Bool( |
---|
| 69 | title = _(u'Etranzact Payoutlet integration enabled'), |
---|
| 70 | default = False, |
---|
| 71 | ) |
---|
| 72 | |
---|
| 73 | |
---|
[15614] | 74 | # Additional fees in custom package add here |
---|
| 75 | |
---|
| 76 | |
---|
| 77 | def getSessionString(): |
---|
| 78 | """Returns the session string from the vocabulary. |
---|
| 79 | """ |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | class ICustomSessionConfigurationAdd(ICustomSessionConfiguration): |
---|
| 83 | """A session configuration object in add mode. |
---|
| 84 | """ |
---|
| 85 | |
---|
| 86 | academic_session = schema.Choice( |
---|
| 87 | title = _(u'Academic Session'), |
---|
| 88 | source = academic_sessions_vocab, |
---|
| 89 | default = None, |
---|
| 90 | required = True, |
---|
| 91 | readonly = False, |
---|
| 92 | ) |
---|
| 93 | |
---|
| 94 | ICustomSessionConfigurationAdd[ |
---|
| 95 | 'academic_session'].order = ICustomSessionConfiguration[ |
---|
| 96 | 'academic_session'].order |
---|