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

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

Remove unused import.

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