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

Last change on this file since 6873 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
RevLine 
[6861]1##
2## interfaces.py
[6869]3from zope.interface import Attribute, invariant
[6864]4from zope import schema
[6861]5from waeup.sirp.interfaces import IWAeUPObject
[6864]6from waeup.sirp.payments.vocabularies import (
7    payment_states, payment_categories)
[6861]8
9class IPaymentsContainer(IWAeUPObject):
10    """A container for all kind of payment objects.
11
12    """
[6864]13
14class IPayment(IWAeUPObject):
15    """A base representation of payments.
16
17    """
[6869]18    p_id = Attribute('Payment identifier.')
[6864]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',
[6865]29        default = u'schoolfee',
[6864]30        vocabulary = payment_categories,
31        required = True,
32        )
33
34    p_item = schema.TextLine(
35        title = u'Payment Item',
[6869]36        default = None,
[6864]37        required = False,
38        )
39
[6869]40    creation_date = schema.Datetime(
[6864]41        title = u'Ticket Creation Date',
[6869]42        readonly = True,
[6864]43        )
44
[6869]45    payment_date = schema.Date(
46        title = u'Payment Date',
47        required = False,
48        readonly = True,
[6864]49        )
50
51    amount_auth = schema.Int(
[6869]52        title = u'Amount Authorized',
[6864]53        default = 0,
54        required = True,
[6869]55        readonly = True,
[6864]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,
[6869]67        readonly = True,
[6864]68        )
69
70class IOnlinePayment(IPayment):
71    """A payment via payment gateways.
72
73    """
74
[6873]75    surcharge_1 = schema.Int(
76        title = u'Surcharge 1',
[6864]77        default = 0,
78        required = False,
[6869]79        readonly = True,
[6864]80        )
81
[6873]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
[6869]96    #order_id = schema.TextLine(
97    #    title = u'Order Id',
98    #    default = None,
99    #    required = True,
100    #    )
[6864]101
102    r_amount_approved = schema.Int(
103        title = u'Response Amount Approved',
104        default = 0,
105        required = False,
[6869]106        readonly = True,
[6864]107        )
108
109    r_code = schema.TextLine(
110        title = u'Response Code',
111        default = None,
[6869]112        required = False,
113        readonly = True,
[6864]114        )
115
116    r_card_num = schema.TextLine(
117        title = u'Response Card Number',
118        default = None,
[6869]119        required = False,
120        readonly = True,
[6864]121        )
Note: See TracBrowser for help on using the repository browser.