[6861] | 1 | ## |
---|
| 2 | ## interfaces.py |
---|
[6864] | 3 | from zope import schema |
---|
[6861] | 4 | from waeup.sirp.interfaces import IWAeUPObject |
---|
[6864] | 5 | from waeup.sirp.payments.vocabularies import ( |
---|
| 6 | payment_states, payment_categories) |
---|
[6861] | 7 | |
---|
| 8 | class IPaymentsContainer(IWAeUPObject): |
---|
| 9 | """A container for all kind of payment objects. |
---|
| 10 | |
---|
| 11 | """ |
---|
[6864] | 12 | |
---|
| 13 | class IPayment(IWAeUPObject): |
---|
| 14 | """A base representation of payments. |
---|
| 15 | |
---|
| 16 | """ |
---|
| 17 | |
---|
| 18 | p_state = schema.Choice( |
---|
| 19 | title = u'Payment State', |
---|
| 20 | default = u'unpaid', |
---|
| 21 | vocabulary = payment_states, |
---|
| 22 | required = True, |
---|
| 23 | ) |
---|
| 24 | |
---|
| 25 | p_category = schema.Choice( |
---|
| 26 | title = u'Payment Category', |
---|
[6865] | 27 | default = u'schoolfee', |
---|
[6864] | 28 | vocabulary = payment_categories, |
---|
| 29 | required = True, |
---|
| 30 | ) |
---|
| 31 | |
---|
| 32 | p_item = schema.TextLine( |
---|
| 33 | title = u'Payment Item', |
---|
| 34 | default = u'Certificate XYZ', |
---|
| 35 | required = False, |
---|
| 36 | ) |
---|
| 37 | |
---|
| 38 | date_of_creation = schema.Date( |
---|
| 39 | title = u'Ticket Creation Date', |
---|
| 40 | ) |
---|
| 41 | |
---|
| 42 | date_of_payment = schema.Date( |
---|
| 43 | title = u'Date of Payment', |
---|
| 44 | ) |
---|
| 45 | |
---|
| 46 | amount_auth = schema.Int( |
---|
| 47 | title = u'Amount authorized', |
---|
| 48 | default = 0, |
---|
| 49 | required = True, |
---|
| 50 | ) |
---|
| 51 | |
---|
| 52 | class ISCPayment(IPayment): |
---|
| 53 | """A scratch card payment. |
---|
| 54 | |
---|
| 55 | """ |
---|
| 56 | |
---|
| 57 | p_code = schema.TextLine( |
---|
| 58 | title = u'Payment Access Code', |
---|
| 59 | default = u'Certificate XYZ', |
---|
| 60 | required = False, |
---|
| 61 | ) |
---|
| 62 | |
---|
| 63 | class IOnlinePayment(IPayment): |
---|
| 64 | """A payment via payment gateways. |
---|
| 65 | |
---|
| 66 | """ |
---|
| 67 | |
---|
| 68 | surcharge = schema.Int( |
---|
| 69 | title = u'Surcharge', |
---|
| 70 | default = 0, |
---|
| 71 | required = False, |
---|
| 72 | ) |
---|
| 73 | |
---|
| 74 | order_id = schema.TextLine( |
---|
| 75 | title = u'Order Id', |
---|
| 76 | default = None, |
---|
| 77 | ) |
---|
| 78 | |
---|
| 79 | r_amount_approved = schema.Int( |
---|
| 80 | title = u'Response Amount Approved', |
---|
| 81 | default = 0, |
---|
| 82 | required = False, |
---|
| 83 | ) |
---|
| 84 | |
---|
| 85 | r_code = schema.TextLine( |
---|
| 86 | title = u'Response Code', |
---|
| 87 | default = None, |
---|
| 88 | ) |
---|
| 89 | |
---|
| 90 | r_card_num = schema.TextLine( |
---|
| 91 | title = u'Response Card Number', |
---|
| 92 | default = None, |
---|
| 93 | ) |
---|