[16717] | 1 | ## $Id: interfaces.py 17216 2022-12-13 11:40:19Z 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 | |
---|
[17216] | 63 | interswitch_webcheckout_enabled = schema.Bool( |
---|
| 64 | title = _(u'Interswitch WebCheckout integration enabled'), |
---|
| 65 | default = False, |
---|
| 66 | ) |
---|
| 67 | |
---|
[15847] | 68 | etranzact_webconnect_enabled = schema.Bool( |
---|
| 69 | title = _(u'Etranzact Webconnect integration enabled'), |
---|
| 70 | default = False, |
---|
| 71 | ) |
---|
| 72 | |
---|
| 73 | etranzact_payoutlet_enabled = schema.Bool( |
---|
| 74 | title = _(u'Etranzact Payoutlet integration enabled'), |
---|
| 75 | default = False, |
---|
| 76 | ) |
---|
| 77 | |
---|
| 78 | |
---|
[15614] | 79 | # Additional fees in custom package add here |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | def getSessionString(): |
---|
| 83 | """Returns the session string from the vocabulary. |
---|
| 84 | """ |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | class ICustomSessionConfigurationAdd(ICustomSessionConfiguration): |
---|
| 88 | """A session configuration object in add mode. |
---|
| 89 | """ |
---|
| 90 | |
---|
| 91 | academic_session = schema.Choice( |
---|
| 92 | title = _(u'Academic Session'), |
---|
| 93 | source = academic_sessions_vocab, |
---|
| 94 | default = None, |
---|
| 95 | required = True, |
---|
| 96 | readonly = False, |
---|
| 97 | ) |
---|
| 98 | |
---|
| 99 | ICustomSessionConfigurationAdd[ |
---|
| 100 | 'academic_session'].order = ICustomSessionConfiguration[ |
---|
| 101 | 'academic_session'].order |
---|