source: main/kofacustom.lpng/trunk/src/kofacustom/lpng/interfaces.py @ 17216

Last change on this file since 17216 was 17216, checked in by Henrik Bettermann, 2 years ago

Implement Interswitch WebCheckout?.

  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1## $Id: interfaces.py 17216 2022-12-13 11:40:19Z 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
19import zope.i18nmessageid
20from zope import schema
21from zc.sourcefactory.basic import BasicSourceFactory
22from waeup.kofa.interfaces import (SimpleKofaVocabulary,
23    ISessionConfiguration, academic_sessions_vocab, IKofaObject,
24    DisablePaymentGroupSource)
25
26_ = MessageFactory = zope.i18nmessageid.MessageFactory('kofacustom.lpng')
27
28class 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    interswitch_webcheckout_enabled = schema.Bool(
64        title = _(u'Interswitch WebCheckout integration enabled'),
65        default = False,
66        )
67
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
79    # Additional fees in custom package add here
80
81
82    def getSessionString():
83        """Returns the session string from the vocabulary.
84        """
85
86
87class 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
99ICustomSessionConfigurationAdd[
100    'academic_session'].order =  ICustomSessionConfiguration[
101    'academic_session'].order
Note: See TracBrowser for help on using the repository browser.