[7195] | 1 | ## $Id: interfaces.py 7195 2011-11-25 07:34:07Z 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] | 18 | from zope.interface import Attribute |
---|
[6864] | 19 | from zope import schema |
---|
[6861] | 20 | from waeup.sirp.interfaces import IWAeUPObject |
---|
[6864] | 21 | from waeup.sirp.payments.vocabularies import ( |
---|
| 22 | payment_states, payment_categories) |
---|
[6861] | 23 | |
---|
| 24 | class IPaymentsContainer(IWAeUPObject): |
---|
| 25 | """A container for all kind of payment objects. |
---|
| 26 | |
---|
| 27 | """ |
---|
[6864] | 28 | |
---|
| 29 | class IPayment(IWAeUPObject): |
---|
| 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 | |
---|
| 73 | class 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 | |
---|
| 85 | class 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 | ) |
---|