1 | ## $Id: interfaces.py 16993 2022-07-06 07:49:44Z henrik $ |
---|
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, |
---|
23 | ISessionConfiguration, academic_sessions_vocab, IKofaObject, |
---|
24 | DisablePaymentGroupSource) |
---|
25 | |
---|
26 | _ = MessageFactory = zope.i18nmessageid.MessageFactory('kofacustom.lpng') |
---|
27 | |
---|
28 | class ICustomSessionConfiguration(IKofaObject): |
---|
29 | """A session configuration object. |
---|
30 | """ |
---|
31 | |
---|
32 | academic_session = schema.Choice( |
---|
33 | title = _(u'Session'), |
---|
34 | source = academic_sessions_vocab, |
---|
35 | default = None, |
---|
36 | required = True, |
---|
37 | readonly = True, |
---|
38 | ) |
---|
39 | |
---|
40 | payment_disabled = schema.List( |
---|
41 | title = _(u'Payment disabled'), |
---|
42 | value_type = schema.Choice( |
---|
43 | source = DisablePaymentGroupSource(), |
---|
44 | ), |
---|
45 | required = False, |
---|
46 | defaultFactory=list, |
---|
47 | ) |
---|
48 | |
---|
49 | def getSessionString(): |
---|
50 | """Return the session string from the vocabulary. |
---|
51 | """ |
---|
52 | |
---|
53 | interswitch_enabled = schema.Bool( |
---|
54 | title = _(u'Interswitch Collegepay integration enabled'), |
---|
55 | default = False, |
---|
56 | ) |
---|
57 | |
---|
58 | interswitch_paydirect_enabled = schema.Bool( |
---|
59 | title = _(u'Interswitch Paydirect integration enabled'), |
---|
60 | default = False, |
---|
61 | ) |
---|
62 | |
---|
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 | |
---|
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 |
---|