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

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

Add more surcharge fields.

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1##
2## interfaces.py
3from zope.interface import Attribute, invariant
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.Date(
46        title = u'Payment Date',
47        required = False,
48        readonly = True,
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    r_amount_approved = schema.Int(
103        title = u'Response Amount Approved',
104        default = 0,
105        required = False,
106        readonly = True,
107        )
108
109    r_code = schema.TextLine(
110        title = u'Response Code',
111        default = None,
112        required = False,
113        readonly = True,
114        )
115
116    r_card_num = schema.TextLine(
117        title = u'Response Card Number',
118        default = None,
119        required = False,
120        readonly = True,
121        )
Note: See TracBrowser for help on using the repository browser.