source: main/waeup.sirp/trunk/src/waeup/sirp/payments/interfaces.py @ 7713

Last change on this file since 7713 was 7627, checked in by Henrik Bettermann, 13 years ago

Move vocabularies to interfaces module.

batchprocessing.txt: fix test

  • Property svn:keywords set to Id
File size: 4.2 KB
RevLine 
[7195]1## $Id: interfaces.py 7627 2012-02-10 20:35:28Z henrik $
[6861]2##
[7195]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##
[6969]18from zope.interface import Attribute
[6864]19from zope import schema
[7627]20from waeup.sirp.interfaces import ISIRPObject, SimpleSIRPVocabulary
[6861]21
[7627]22payment_states = SimpleSIRPVocabulary(
23    ('Not yet paid','unpaid'),
24    ('Paid','paid'),
25    ('Failed','failed'),
26    )
27
28payment_categories = SimpleSIRPVocabulary(
29    ('School Fee','schoolfee'),
30    ('Clearance','clearance'),
31    ('Bed Allocation','bed_allocation'),
32    ('Hostel Maintenance','hostel_maintenance'),
33    ('Transfer','transfer'),
34    ('Gown','gown'),
35    ('Acceptance Fee', 'acceptance'),
36    )
37
[7321]38class IPaymentsContainer(ISIRPObject):
[6861]39    """A container for all kind of payment objects.
40
41    """
[6864]42
[7321]43class IPayment(ISIRPObject):
[6864]44    """A base representation of payments.
45
46    """
[6869]47    p_id = Attribute('Payment identifier.')
[6864]48
49    p_category = schema.Choice(
50        title = u'Payment Category',
[6865]51        default = u'schoolfee',
[6864]52        vocabulary = payment_categories,
53        required = True,
54        )
55
56    p_item = schema.TextLine(
57        title = u'Payment Item',
[6869]58        default = None,
[6864]59        required = False,
60        )
61
[7020]62    p_state = schema.Choice(
63        title = u'Payment State',
64        default = u'unpaid',
65        vocabulary = payment_states,
66        required = True,
67        )
68
[6869]69    creation_date = schema.Datetime(
[6864]70        title = u'Ticket Creation Date',
[7623]71        readonly = False,
[6864]72        )
73
[6930]74    payment_date = schema.Datetime(
[6869]75        title = u'Payment Date',
76        required = False,
[6934]77        readonly = False,
[6864]78        )
79
80    amount_auth = schema.Int(
[6869]81        title = u'Amount Authorized',
[6864]82        default = 0,
83        required = True,
[6869]84        readonly = True,
[6864]85        )
86
87class ISCPayment(IPayment):
88    """A scratch card payment.
89
90    """
91
92    p_code = schema.TextLine(
93        title = u'Payment Access Code',
94        default = u'Certificate XYZ',
95        required = False,
[6869]96        readonly = True,
[6864]97        )
98
99class IOnlinePayment(IPayment):
100    """A payment via payment gateways.
101
102    """
103
[6873]104    surcharge_1 = schema.Int(
105        title = u'Surcharge 1',
[6864]106        default = 0,
107        required = False,
[6869]108        readonly = True,
[6864]109        )
110
[6873]111    surcharge_2 = schema.Int(
112        title = u'Surcharge 2',
113        default = 0,
114        required = False,
115        readonly = True,
116        )
117
118    surcharge_3 = schema.Int(
119        title = u'Surcharge 3',
120        default = 0,
121        required = False,
122        readonly = True,
123        )
124
[6869]125    #order_id = schema.TextLine(
126    #    title = u'Order Id',
127    #    default = None,
128    #    required = True,
129    #    )
[6864]130
[6930]131    ac = schema.TextLine(
132        title = u'Activation Code',
133        default = None,
134        required = False,
135        readonly = False,
136        )
137
[6864]138    r_amount_approved = schema.Int(
139        title = u'Response Amount Approved',
140        default = 0,
141        required = False,
[6930]142        readonly = False,
[6864]143        )
144
[7623]145    r_desc = schema.TextLine(
146        title = u'Response Description',
147        default = None,
148        required = False,
149        readonly = False,
150        )
151
152    r_pay_reference = schema.TextLine(
153        title = u'Response Payment Reference',
154        default = None,
155        required = False,
156        readonly = False,
157        )
158
[6864]159    r_code = schema.TextLine(
160        title = u'Response Code',
161        default = None,
[6869]162        required = False,
[6930]163        readonly = False,
[6864]164        )
165
166    r_card_num = schema.TextLine(
167        title = u'Response Card Number',
168        default = None,
[6869]169        required = False,
[6930]170        readonly = False,
[6864]171        )
Note: See TracBrowser for help on using the repository browser.