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

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

Change order of fields slightly.

  • Property svn:keywords set to Id
File size: 2.7 KB
RevLine 
[6861]1##
2## interfaces.py
[6969]3from zope.interface import Attribute
[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_category = schema.Choice(
21        title = u'Payment Category',
[6865]22        default = u'schoolfee',
[6864]23        vocabulary = payment_categories,
24        required = True,
25        )
26
27    p_item = schema.TextLine(
28        title = u'Payment Item',
[6869]29        default = None,
[6864]30        required = False,
31        )
32
[7020]33    p_state = schema.Choice(
34        title = u'Payment State',
35        default = u'unpaid',
36        vocabulary = payment_states,
37        required = True,
38        )
39
[6869]40    creation_date = schema.Datetime(
[6864]41        title = u'Ticket Creation Date',
[6869]42        readonly = True,
[6864]43        )
44
[6930]45    payment_date = schema.Datetime(
[6869]46        title = u'Payment Date',
47        required = False,
[6934]48        readonly = False,
[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
[6930]102    ac = schema.TextLine(
103        title = u'Activation Code',
104        default = None,
105        required = False,
106        readonly = False,
107        )
108
[6864]109    r_amount_approved = schema.Int(
110        title = u'Response Amount Approved',
111        default = 0,
112        required = False,
[6930]113        readonly = False,
[6864]114        )
115
116    r_code = schema.TextLine(
117        title = u'Response Code',
118        default = None,
[6869]119        required = False,
[6930]120        readonly = False,
[6864]121        )
122
123    r_card_num = schema.TextLine(
124        title = u'Response Card Number',
125        default = None,
[6869]126        required = False,
[6930]127        readonly = False,
[6864]128        )
Note: See TracBrowser for help on using the repository browser.