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

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

Replace the term 'WAeUP' by SIRP which is a WAeUP product.

  • Property svn:keywords set to Id
File size: 3.5 KB
RevLine 
[7195]1## $Id: interfaces.py 7321 2011-12-10 06:15:17Z 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
[7321]20from waeup.sirp.interfaces import ISIRPObject
[6864]21from waeup.sirp.payments.vocabularies import (
22    payment_states, payment_categories)
[6861]23
[7321]24class IPaymentsContainer(ISIRPObject):
[6861]25    """A container for all kind of payment objects.
26
27    """
[6864]28
[7321]29class IPayment(ISIRPObject):
[6864]30    """A base representation of payments.
31
32    """
[6869]33    p_id = Attribute('Payment identifier.')
[6864]34
35    p_category = schema.Choice(
36        title = u'Payment Category',
[6865]37        default = u'schoolfee',
[6864]38        vocabulary = payment_categories,
39        required = True,
40        )
41
42    p_item = schema.TextLine(
43        title = u'Payment Item',
[6869]44        default = None,
[6864]45        required = False,
46        )
47
[7020]48    p_state = schema.Choice(
49        title = u'Payment State',
50        default = u'unpaid',
51        vocabulary = payment_states,
52        required = True,
53        )
54
[6869]55    creation_date = schema.Datetime(
[6864]56        title = u'Ticket Creation Date',
[6869]57        readonly = True,
[6864]58        )
59
[6930]60    payment_date = schema.Datetime(
[6869]61        title = u'Payment Date',
62        required = False,
[6934]63        readonly = False,
[6864]64        )
65
66    amount_auth = schema.Int(
[6869]67        title = u'Amount Authorized',
[6864]68        default = 0,
69        required = True,
[6869]70        readonly = True,
[6864]71        )
72
73class ISCPayment(IPayment):
74    """A scratch card payment.
75
76    """
77
78    p_code = schema.TextLine(
79        title = u'Payment Access Code',
80        default = u'Certificate XYZ',
81        required = False,
[6869]82        readonly = True,
[6864]83        )
84
85class IOnlinePayment(IPayment):
86    """A payment via payment gateways.
87
88    """
89
[6873]90    surcharge_1 = schema.Int(
91        title = u'Surcharge 1',
[6864]92        default = 0,
93        required = False,
[6869]94        readonly = True,
[6864]95        )
96
[6873]97    surcharge_2 = schema.Int(
98        title = u'Surcharge 2',
99        default = 0,
100        required = False,
101        readonly = True,
102        )
103
104    surcharge_3 = schema.Int(
105        title = u'Surcharge 3',
106        default = 0,
107        required = False,
108        readonly = True,
109        )
110
[6869]111    #order_id = schema.TextLine(
112    #    title = u'Order Id',
113    #    default = None,
114    #    required = True,
115    #    )
[6864]116
[6930]117    ac = schema.TextLine(
118        title = u'Activation Code',
119        default = None,
120        required = False,
121        readonly = False,
122        )
123
[6864]124    r_amount_approved = schema.Int(
125        title = u'Response Amount Approved',
126        default = 0,
127        required = False,
[6930]128        readonly = False,
[6864]129        )
130
131    r_code = schema.TextLine(
132        title = u'Response Code',
133        default = None,
[6869]134        required = False,
[6930]135        readonly = False,
[6864]136        )
137
138    r_card_num = schema.TextLine(
139        title = u'Response Card Number',
140        default = None,
[6869]141        required = False,
[6930]142        readonly = False,
[6864]143        )
Note: See TracBrowser for help on using the repository browser.